]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*! |
2 | @file | |
3 | Defines `boost::hana::detail::create`. | |
4 | ||
b32b8144 | 5 | @copyright Louis Dionne 2013-2017 |
7c673cae FG |
6 | Distributed under the Boost Software License, Version 1.0. |
7 | (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) | |
8 | */ | |
9 | ||
10 | #ifndef BOOST_HANA_DETAIL_CREATE_HPP | |
11 | #define BOOST_HANA_DETAIL_CREATE_HPP | |
12 | ||
13 | #include <boost/hana/config.hpp> | |
14 | #include <boost/hana/detail/decay.hpp> | |
15 | ||
16 | ||
1e59de90 | 17 | namespace boost { namespace hana { namespace detail { |
7c673cae FG |
18 | //! @ingroup group-details |
19 | //! Implementation of the generic `std::make_xxx` pattern for arbitrary | |
20 | //! `xxx`s. | |
21 | template <template <typename ...> class T> | |
22 | struct create { | |
23 | template <typename ...X> | |
24 | constexpr T<typename detail::decay<X>::type...> | |
25 | operator()(X&& ...x) const { | |
26 | return T<typename detail::decay<X>::type...>{ | |
27 | static_cast<X&&>(x)... | |
28 | }; | |
29 | } | |
30 | }; | |
1e59de90 | 31 | } }} // end namespace boost::hana |
7c673cae FG |
32 | |
33 | #endif // !BOOST_HANA_DETAIL_CREATE_HPP |