commit 712c960d3971e81c46c5270b2f6dc15190ea3b9c
parent 9819f537d9685cc30da219c9ea202d9fb5ab5d8c
Author: Dominik Schmidt <das1993@hotmail.com>
Date: Thu, 27 Aug 2015 00:19:49 +0200
Add a length property to Vectors
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/puzzle.d b/puzzle.d
@@ -136,6 +136,9 @@ struct DVec{
puzzle_fill_cvec_from_dvec(ctx,&cvec.vec,&vec);
return cvec;
}
+ @property size_t length(){
+ return vec.sizeof_vec;
+ }
}
struct CVec{
PuzzleCvec vec;
@@ -156,4 +159,7 @@ struct CVec{
double compare(in ref CVec b, bool hasText=false){
return puzzle_vector_normalized_distance(ctx,&vec,&b.vec,(hasText) ? 1 : 0);
}
+ @property size_t length(){
+ return vec.sizeof_vec;
+ }
}