/Src/Dependencies/Boost/boost/fusion/container/list/list.hpp

http://hadesmem.googlecode.com/ · C++ Header · 68 lines · 44 code · 11 blank · 13 comment · 0 complexity · 494ffc862be81ca6793cb4ff0395844a MD5 · raw file

  1. /*=============================================================================
  2. Copyright (c) 2005 Joel de Guzman
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #if !defined(FUSION_LIST_07172005_1153)
  7. #define FUSION_LIST_07172005_1153
  8. #include <boost/fusion/container/list/list_fwd.hpp>
  9. #include <boost/fusion/container/list/detail/list_to_cons.hpp>
  10. namespace boost { namespace fusion
  11. {
  12. struct nil;
  13. struct void_;
  14. template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename T)>
  15. struct list
  16. : detail::list_to_cons<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, T)>::type
  17. {
  18. private:
  19. typedef
  20. detail::list_to_cons<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, T)>
  21. list_to_cons;
  22. public:
  23. typedef typename list_to_cons::type inherited_type;
  24. list()
  25. : inherited_type() {}
  26. template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename U)>
  27. list(list<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, U)> const& rhs)
  28. : inherited_type(rhs) {}
  29. template <typename Sequence>
  30. list(Sequence const& rhs)
  31. : inherited_type(rhs) {}
  32. // Expand a couple of forwarding constructors for arguments
  33. // of type (T0), (T0, T1), (T0, T1, T2) etc. Exanple:
  34. //
  35. // list(
  36. // typename detail::call_param<T0>::type _0
  37. // , typename detail::call_param<T1>::type _1)
  38. // : inherited_type(list_to_cons::call(_0, _1)) {}
  39. #include <boost/fusion/container/list/detail/list_forward_ctor.hpp>
  40. template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename U)>
  41. list&
  42. operator=(list<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, U)> const& rhs)
  43. {
  44. inherited_type::operator=(rhs);
  45. return *this;
  46. }
  47. template <typename T>
  48. list&
  49. operator=(T const& rhs)
  50. {
  51. inherited_type::operator=(rhs);
  52. return *this;
  53. }
  54. };
  55. }}
  56. #endif