From 783d643cb6de85474c33fef5d5cf4f369c371aff Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Thu, 19 Jan 2017 10:26:32 +0100 Subject: [PATCH] Add functor Construct_array --- STL_Extension/include/CGAL/array.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/array.h b/STL_Extension/include/CGAL/array.h index a2af9939344..31084318b00 100644 --- a/STL_Extension/include/CGAL/array.h +++ b/STL_Extension/include/CGAL/array.h @@ -46,6 +46,16 @@ namespace cpp0x = cpp11; using cpp11::array; +struct Construct_array +{ + template + cpp11::array operator()(const T& t, const Args& ... args) + { + cpp11::array< T, 1 + sizeof...(Args) > a = { { t, static_cast(args)... } }; + return a; + } +}; + // The make_array() function simply constructs an std::array. // It is needed for cases where a std::array is used as a class data // member and you want to initialize it in the member initializers list. @@ -134,7 +144,7 @@ make_array(const T& b1, const T& b2, const T& b3, const T& b4, const T& b5, cpp11::array a = { { b1, b2, b3, b4, b5, b6 } }; return a; } - + #endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES } //namespace CGAL