begin_end.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef BOOST_MPL_BEGIN_END_HPP_INCLUDED
  2. #define BOOST_MPL_BEGIN_END_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2000-2004
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/mpl for documentation.
  10. // $Id$
  11. // $Date$
  12. // $Revision$
  13. #include <boost/mpl/begin_end_fwd.hpp>
  14. #include <boost/mpl/aux_/begin_end_impl.hpp>
  15. #include <boost/mpl/sequence_tag.hpp>
  16. #include <boost/mpl/aux_/na_spec.hpp>
  17. #include <boost/mpl/aux_/lambda_support.hpp>
  18. namespace boost { namespace mpl {
  19. // agurt, 13/sep/02: switched from inheritance to typedef; MSVC is more
  20. // happy this way (less ETI-related errors), and it doesn't affect
  21. // anything else
  22. template<
  23. typename BOOST_MPL_AUX_NA_PARAM(Sequence)
  24. >
  25. struct begin
  26. {
  27. typedef typename sequence_tag<Sequence>::type tag_;
  28. typedef typename begin_impl< tag_ >
  29. ::template apply< Sequence >::type type;
  30. BOOST_MPL_AUX_LAMBDA_SUPPORT(1,begin,(Sequence))
  31. };
  32. template<
  33. typename BOOST_MPL_AUX_NA_PARAM(Sequence)
  34. >
  35. struct end
  36. {
  37. typedef typename sequence_tag<Sequence>::type tag_;
  38. typedef typename end_impl< tag_ >
  39. ::template apply< Sequence >::type type;
  40. BOOST_MPL_AUX_LAMBDA_SUPPORT(1,end,(Sequence))
  41. };
  42. BOOST_MPL_AUX_NA_SPEC(1, begin)
  43. BOOST_MPL_AUX_NA_SPEC(1, end)
  44. }}
  45. #endif // BOOST_MPL_BEGIN_END_HPP_INCLUDED