traits_lambda_spec.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2000-2008
  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/sequence_tag_fwd.hpp>
  14. #include <boost/mpl/void.hpp>
  15. #include <boost/mpl/aux_/preprocessor/params.hpp>
  16. #include <boost/mpl/aux_/config/lambda.hpp>
  17. #if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
  18. # define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) /**/
  19. #elif !defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
  20. # define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
  21. template<> struct trait<void_> \
  22. { \
  23. template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \
  24. { \
  25. }; \
  26. }; \
  27. /**/
  28. #else
  29. # define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
  30. template<> struct trait<void_> \
  31. { \
  32. template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \
  33. { \
  34. }; \
  35. }; \
  36. template<> struct trait<int> \
  37. { \
  38. template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \
  39. { \
  40. typedef int type; \
  41. }; \
  42. }; \
  43. /**/
  44. #endif // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
  45. #define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) \
  46. BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
  47. template<> struct trait<non_sequence_tag> {}; \
  48. /**/
  49. #endif // BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED