diff options
Diffstat (limited to 'boost/geometry/geometries/multi_polygon.hpp')
-rw-r--r-- | boost/geometry/geometries/multi_polygon.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/boost/geometry/geometries/multi_polygon.hpp b/boost/geometry/geometries/multi_polygon.hpp index 228074cd34..51fcf235f8 100644 --- a/boost/geometry/geometries/multi_polygon.hpp +++ b/boost/geometry/geometries/multi_polygon.hpp @@ -3,6 +3,7 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -22,6 +23,13 @@ #include <boost/geometry/core/tags.hpp> #include <boost/geometry/geometries/concepts/polygon_concept.hpp> +#ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST +#include <boost/config.hpp> +#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST +#include <initializer_list> +#endif +#endif + namespace boost { namespace geometry { @@ -48,6 +56,39 @@ template class multi_polygon : public Container<Polygon, Allocator<Polygon> > { BOOST_CONCEPT_ASSERT( (concept::Polygon<Polygon>) ); + +#ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST + + typedef Container<Polygon, Allocator<Polygon> > base_type; + +public: + /// \constructor_default{multi_polygon} + multi_polygon() + : base_type() + {} + +#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST + + /// \constructor_initializer_list{multi_polygon} + inline multi_polygon(std::initializer_list<Polygon> l) + : base_type(l.begin(), l.end()) + {} + +// Commented out for now in order to support Boost.Assign +// Without this assignment operator first the object should be created +// from initializer list, then it shoudl be moved. +//// Without this workaround in MSVC the assignment operator is ambiguous +//#ifndef BOOST_MSVC +// /// \assignment_initializer_list{multi_polygon} +// inline multi_polygon & operator=(std::initializer_list<Polygon> l) +// { +// base_type::assign(l.begin(), l.end()); +// return *this; +// } +//#endif + +#endif +#endif }; |