cons_tie.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 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_CONS_TIE_07182005_0854)
  7. #define FUSION_CONS_TIE_07182005_0854
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/container/list/cons.hpp>
  10. namespace boost { namespace fusion
  11. {
  12. struct nil_;
  13. namespace result_of
  14. {
  15. template <typename Car, typename Cdr = nil_>
  16. struct cons_tie
  17. {
  18. typedef cons<Car&, Cdr> type;
  19. };
  20. }
  21. // $$$ do we really want a cons_tie? $$$
  22. template <typename Car>
  23. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  24. inline cons<Car&>
  25. cons_tie(Car& car)
  26. {
  27. return cons<Car&>(car);
  28. }
  29. // $$$ do we really want a cons_tie? $$$
  30. template <typename Car, typename Cdr>
  31. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  32. inline cons<Car&, Cdr>
  33. cons_tie(Car& car, Cdr const& cdr)
  34. {
  35. return cons<Car&, Cdr>(car, cdr);
  36. }
  37. }}
  38. #endif