]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | // (C) Copyright Tobias Schwinger | |
3 | // | |
4 | // Use modification and distribution are subject to the boost Software License, | |
5 | // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). | |
6 | ||
7 | //------------------------------------------------------------------------------ | |
8 | ||
9 | #ifndef BOOST_FT_DETAIL_TO_SEQUENCE_HPP_INCLUDED | |
10 | #define BOOST_FT_DETAIL_TO_SEQUENCE_HPP_INCLUDED | |
11 | ||
12 | #include <boost/mpl/eval_if.hpp> | |
13 | #include <boost/mpl/identity.hpp> | |
14 | #include <boost/mpl/is_sequence.hpp> | |
15 | #include <boost/mpl/placeholders.hpp> | |
16 | #include <boost/type_traits/add_reference.hpp> | |
17 | ||
18 | #include <boost/function_types/is_callable_builtin.hpp> | |
19 | ||
20 | namespace boost { namespace function_types { namespace detail { | |
21 | ||
22 | // wrap first arguments in components, if callable builtin type | |
23 | template<typename T> | |
24 | struct to_sequence | |
25 | { | |
26 | typedef typename | |
27 | mpl::eval_if | |
28 | < is_callable_builtin<T> | |
29 | , to_sequence< components<T> > | |
30 | , mpl::identity< T > | |
31 | >::type | |
32 | type; | |
33 | }; | |
34 | ||
35 | // reduce template instantiations, if possible | |
36 | template<typename T, typename U> | |
37 | struct to_sequence< components<T,U> > | |
38 | { | |
39 | typedef typename components<T,U>::types type; | |
40 | }; | |
41 | ||
42 | } } } // namespace ::boost::function_types::detail | |
43 | ||
44 | #endif | |
45 |