X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgeometry%2Funion.h;h=13eb7080442c625369f2c565fbb71405df5c9955;hb=f7dcf3f0be55316bf20ac0c318dd90cb78a75c80;hp=fadeff2ac9270dd71718aade2e733504e6a44e5b;hpb=68389c29cf88d6522dcfa00b5e2a5166e3947210;p=libs%2Fmath.git diff --git a/source/geometry/union.h b/source/geometry/union.h index fadeff2..13eb708 100644 --- a/source/geometry/union.h +++ b/source/geometry/union.h @@ -23,9 +23,13 @@ struct UnionOps template class Union: public CompositeShape > { +private: + Union() { } public: Union(const Shape &, const Shape &); - Union(const std::vector *> &); + + template + static Union from_iterator_range(const Iter &, const Iter &); virtual Union *clone() const; }; @@ -36,14 +40,18 @@ inline Union::Union(const Shape &s1, const Shape &s2): { } template -inline Union::Union(const std::vector *> &s): - CompositeShape >(s) -{ } +template +inline Union Union::from_iterator_range(const Iter &begin, const Iter &end) +{ + Union shape; + shape.init_from_iter_range(begin, end); + return shape; +} template inline Union *Union::clone() const { - return new Union(this->shapes); + return new Union(*this); }