mirror of https://github.com/CGAL/cgal
Add functor Construct_array
This commit is contained in:
parent
40e901fa4b
commit
783d643cb6
|
|
@ -46,6 +46,16 @@ namespace cpp0x = cpp11;
|
||||||
using cpp11::array;
|
using cpp11::array;
|
||||||
|
|
||||||
|
|
||||||
|
struct Construct_array
|
||||||
|
{
|
||||||
|
template <typename T, typename... Args>
|
||||||
|
cpp11::array<T, 1 + sizeof...(Args)> operator()(const T& t, const Args& ... args)
|
||||||
|
{
|
||||||
|
cpp11::array< T, 1 + sizeof...(Args) > a = { { t, static_cast<T>(args)... } };
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// The make_array() function simply constructs an std::array.
|
// The make_array() function simply constructs an std::array.
|
||||||
// It is needed for cases where a std::array is used as a class data
|
// 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.
|
// member and you want to initialize it in the member initializers list.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue