protect.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef BOOST_MPL_PROTECT_HPP_INCLUDED
  2. #define BOOST_MPL_PROTECT_HPP_INCLUDED
  3. // Copyright Peter Dimov 2001
  4. // Copyright Aleksey Gurtovoy 2002-2004
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // See http://www.boost.org/libs/mpl for documentation.
  11. // $Id$
  12. // $Date$
  13. // $Revision$
  14. #include <boost/mpl/aux_/arity.hpp>
  15. #include <boost/mpl/aux_/config/dtp.hpp>
  16. #include <boost/mpl/aux_/nttp_decl.hpp>
  17. #include <boost/mpl/aux_/na_spec.hpp>
  18. namespace boost { namespace mpl {
  19. template<
  20. typename BOOST_MPL_AUX_NA_PARAM(T)
  21. , int not_le_ = 0
  22. >
  23. struct protect : T
  24. {
  25. #if BOOST_WORKAROUND(__EDG_VERSION__, == 238)
  26. typedef mpl::protect type;
  27. #else
  28. typedef protect type;
  29. #endif
  30. };
  31. #if defined(BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
  32. namespace aux {
  33. template< BOOST_MPL_AUX_NTTP_DECL(int, N), typename T >
  34. struct arity< protect<T>, N >
  35. : arity<T,N>
  36. {
  37. };
  38. } // namespace aux
  39. #endif
  40. BOOST_MPL_AUX_NA_SPEC_MAIN(1, protect)
  41. #if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
  42. BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(1, 1, protect)
  43. #endif
  44. }}
  45. #endif // BOOST_MPL_PROTECT_HPP_INCLUDED