/*============================================================================= Copyright (c) 2011-2014 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #ifndef SPROUT_ARRAY_MAKE_ARRAY_HPP #define SPROUT_ARRAY_MAKE_ARRAY_HPP #include #include #include #include #include #include #include namespace sprout { // // make_array // template inline SPROUT_CONSTEXPR sprout::array::type, sizeof...(Types)> make_array(Types&&... args) { return sprout::array::type, sizeof...(Types)>{{T(SPROUT_FORWARD(Types, args))...}}; } // !!! OLD: // template // inline SPROUT_CONSTEXPR sprout::array::type, sizeof...(Types)> // make_array(Types&&... args) { // typedef sprout::array< // typename sprout::common_decay::type, // sizeof...(Types) // > type; // return type{{typename sprout::common_decay::type(SPROUT_FORWARD(Types, args))...}}; // } // // make_common_array // template inline SPROUT_CONSTEXPR sprout::array::type, sizeof...(Types)> make_common_array(Types&&... args) { typedef sprout::array< typename sprout::common_decay::type, sizeof...(Types) > type; return type{{typename sprout::common_decay::type(SPROUT_FORWARD(Types, args))...}}; } // // convert_array // [[deprecated]] // template SPROUT_DEPRECATED inline SPROUT_CONSTEXPR sprout::array convert_array(Converter&& conv, Types&&... args) { return sprout::make_array(SPROUT_FORWARD(Converter, conv)(SPROUT_FORWARD(Types, args))...); } } // namespace sprout #endif // #ifndef SPROUT_ARRAY_MAKE_ARRAY_HPP