pair.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef BOOST_MPL_PAIR_HPP_INCLUDED
  2. #define BOOST_MPL_PAIR_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2001-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/aux_/msvc_eti_base.hpp>
  14. #include <boost/mpl/aux_/na_spec.hpp>
  15. #include <boost/mpl/aux_/lambda_support.hpp>
  16. #include <boost/mpl/aux_/config/eti.hpp>
  17. namespace boost { namespace mpl {
  18. template<
  19. typename BOOST_MPL_AUX_NA_PARAM(T1)
  20. , typename BOOST_MPL_AUX_NA_PARAM(T2)
  21. >
  22. struct pair
  23. {
  24. typedef pair type;
  25. typedef T1 first;
  26. typedef T2 second;
  27. BOOST_MPL_AUX_LAMBDA_SUPPORT(2,pair,(T1,T2))
  28. };
  29. template<
  30. typename BOOST_MPL_AUX_NA_PARAM(P)
  31. >
  32. struct first
  33. {
  34. #if !defined(BOOST_MPL_CFG_MSVC_70_ETI_BUG)
  35. typedef typename P::first type;
  36. #else
  37. typedef typename aux::msvc_eti_base<P>::first type;
  38. #endif
  39. BOOST_MPL_AUX_LAMBDA_SUPPORT(1,first,(P))
  40. };
  41. template<
  42. typename BOOST_MPL_AUX_NA_PARAM(P)
  43. >
  44. struct second
  45. {
  46. #if !defined(BOOST_MPL_CFG_MSVC_70_ETI_BUG)
  47. typedef typename P::second type;
  48. #else
  49. typedef typename aux::msvc_eti_base<P>::second type;
  50. #endif
  51. BOOST_MPL_AUX_LAMBDA_SUPPORT(1,second,(P))
  52. };
  53. BOOST_MPL_AUX_NA_SPEC_NO_ETI(2, pair)
  54. BOOST_MPL_AUX_NA_SPEC(1, first)
  55. BOOST_MPL_AUX_NA_SPEC(1, second)
  56. }}
  57. #endif // BOOST_MPL_PAIR_HPP_INCLUDED