File indexing completed on 2025-12-16 09:47:58
0001
0002
0003
0004
0005
0006
0007 #ifndef FUSION_LIST_10262014_0537
0008 #define FUSION_LIST_10262014_0537
0009
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/fusion/container/list/list_fwd.hpp>
0012
0013
0014
0015
0016 #if !defined(BOOST_FUSION_HAS_VARIADIC_LIST)
0017 # include <boost/fusion/container/list/detail/cpp03/list.hpp>
0018 #else
0019
0020
0021
0022
0023 #include <utility>
0024 #include <boost/fusion/container/list/detail/list_to_cons.hpp>
0025
0026 namespace boost { namespace fusion
0027 {
0028 struct nil_;
0029
0030 template <>
0031 struct list<>
0032 : detail::list_to_cons<>::type
0033 {
0034 private:
0035 typedef detail::list_to_cons<> list_to_cons;
0036 typedef list_to_cons::type inherited_type;
0037
0038 public:
0039 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0040 list()
0041 : inherited_type() {}
0042
0043 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0044 template <typename Sequence>
0045 BOOST_FUSION_GPU_ENABLED
0046 list(Sequence const& rhs)
0047 : inherited_type(rhs) {}
0048
0049 template <typename Sequence>
0050 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0051 list&
0052 operator=(Sequence const& rhs)
0053 {
0054 inherited_type::operator=(rhs);
0055 return *this;
0056 }
0057 #else
0058 template <typename Sequence>
0059 BOOST_FUSION_GPU_ENABLED
0060 list(Sequence&& rhs)
0061 : inherited_type(std::forward<Sequence>(rhs)) {}
0062
0063 template <typename Sequence>
0064 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0065 list&
0066 operator=(Sequence&& rhs)
0067 {
0068 inherited_type::operator=(std::forward<Sequence>(rhs));
0069 return *this;
0070 }
0071 #endif
0072 };
0073
0074 template <typename ...T>
0075 struct list
0076 : detail::list_to_cons<T...>::type
0077 {
0078 private:
0079 typedef detail::list_to_cons<T...> list_to_cons;
0080 typedef typename list_to_cons::type inherited_type;
0081
0082 public:
0083 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0084 list()
0085 : inherited_type() {}
0086
0087 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0088 template <typename Sequence>
0089 BOOST_FUSION_GPU_ENABLED
0090 list(Sequence const& rhs)
0091 : inherited_type(rhs) {}
0092 #else
0093 template <typename Sequence>
0094 BOOST_FUSION_GPU_ENABLED
0095 list(Sequence&& rhs)
0096 : inherited_type(std::forward<Sequence>(rhs)) {}
0097 #endif
0098
0099 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0100 explicit
0101 list(typename detail::call_param<T>::type ...args)
0102 : inherited_type(list_to_cons::call(args...)) {}
0103
0104 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0105 template <typename Sequence>
0106 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0107 list&
0108 operator=(Sequence const& rhs)
0109 {
0110 inherited_type::operator=(rhs);
0111 return *this;
0112 }
0113 #else
0114 template <typename Sequence>
0115 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0116 list&
0117 operator=(Sequence&& rhs)
0118 {
0119 inherited_type::operator=(std::forward<Sequence>(rhs));
0120 return *this;
0121 }
0122 #endif
0123 };
0124 }}
0125
0126 #endif
0127 #endif