/Src/Dependencies/Boost/boost/fusion/container/generation/make_cons.hpp

http://hadesmem.googlecode.com/ · C++ Header · 43 lines · 29 code · 7 blank · 7 comment · 0 complexity · 3620ecc6e9ea610c46cae00c85065ba3 MD5 · raw file

  1. /*=============================================================================
  2. Copyright (c) 2005 Joel de Guzman
  3. Copyright (c) 2005 Eric Niebler
  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. #if !defined(FUSION_MAKE_CONS_07172005_0918)
  8. #define FUSION_MAKE_CONS_07172005_0918
  9. #include <boost/fusion/support/detail/as_fusion_element.hpp>
  10. #include <boost/fusion/container/list/cons.hpp>
  11. namespace boost { namespace fusion
  12. {
  13. struct nil;
  14. namespace result_of
  15. {
  16. template <typename Car, typename Cdr = nil>
  17. struct make_cons
  18. {
  19. typedef cons<typename detail::as_fusion_element<Car>::type, Cdr> type;
  20. };
  21. }
  22. template <typename Car>
  23. inline cons<typename detail::as_fusion_element<Car>::type>
  24. make_cons(Car const& car)
  25. {
  26. return cons<typename detail::as_fusion_element<Car>::type>(car);
  27. }
  28. template <typename Car, typename Cdr>
  29. inline cons<typename detail::as_fusion_element<Car>::type, Cdr>
  30. make_cons(Car const& car, Cdr const& cdr)
  31. {
  32. return cons<typename detail::as_fusion_element<Car>::type, Cdr>(car, cdr);
  33. }
  34. }}
  35. #endif