cons_tie.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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/container/list/cons.hpp>
  9. namespace boost { namespace fusion
  10. {
  11. struct nil_;
  12. namespace result_of
  13. {
  14. template <typename Car, typename Cdr = nil_>
  15. struct cons_tie
  16. {
  17. typedef cons<Car&, Cdr> type;
  18. };
  19. }
  20. // $$$ do we really want a cons_tie? $$$
  21. template <typename Car>
  22. inline cons<Car&>
  23. cons_tie(Car& car)
  24. {
  25. return cons<Car&>(car);
  26. }
  27. // $$$ do we really want a cons_tie? $$$
  28. template <typename Car, typename Cdr>
  29. inline cons<Car&, Cdr>
  30. cons_tie(Car& car, Cdr const& cdr)
  31. {
  32. return cons<Car&, Cdr>(car, cdr);
  33. }
  34. }}
  35. #endif