]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/container/vector/detail/vector_forward_ctor.hpp
Updated boost to v1.55.0
[rsem.git] / boost / fusion / container / vector / detail / vector_forward_ctor.hpp
1 /*=============================================================================
2     Copyright (c) 2001-2011 Joel de Guzman
3
4     Distributed under the Boost Software License, Version 1.0. (See accompanying 
5     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #ifndef BOOST_PP_IS_ITERATING
8 #if !defined(FUSION_VECTOR_FORWARD_CTOR_07122005_1123)
9 #define FUSION_VECTOR_FORWARD_CTOR_07122005_1123
10
11 #include <boost/preprocessor/iterate.hpp>
12 #include <boost/preprocessor/repetition/enum_params.hpp>
13 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
14
15 #define FUSION_FORWARD_CTOR_FORWARD(z, n, _)    std::forward<U##n>(_##n)
16
17 #define BOOST_PP_FILENAME_1 \
18     <boost/fusion/container/vector/detail/vector_forward_ctor.hpp>
19 #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE)
20 #include BOOST_PP_ITERATE()
21
22 #undef FUSION_FORWARD_CTOR_FORWARD
23 #endif
24 #else // defined(BOOST_PP_IS_ITERATING)
25 ///////////////////////////////////////////////////////////////////////////////
26 //
27 //  Preprocessor vertical repetition code
28 //
29 ///////////////////////////////////////////////////////////////////////////////
30
31 #define N BOOST_PP_ITERATION()
32
33 #if N == 1
34     explicit
35 #endif
36     vector(BOOST_PP_ENUM_BINARY_PARAMS(
37         N, typename detail::call_param<T, >::type _))
38         : vec(BOOST_PP_ENUM_PARAMS(N, _)) {}
39
40 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
41     template <BOOST_PP_ENUM_PARAMS(N, typename U)>
42 #if N == 1
43     explicit
44 #endif
45     vector(BOOST_PP_ENUM_BINARY_PARAMS(N, U, && _))
46         : vec(BOOST_PP_ENUM(N, FUSION_FORWARD_CTOR_FORWARD, _)) {}
47 #endif
48
49 #undef N
50 #endif // defined(BOOST_PP_IS_ITERATING)
51