local.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ///////////////////////////////////////////////////////////////////////////////
  2. /// \file local.hpp
  3. /// Contains macros to ease the generation of repetitious code constructs
  4. //
  5. // Copyright 2008 Eric Niebler. Distributed under the Boost
  6. // Software License, Version 1.0. (See accompanying file
  7. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  8. #ifndef BOOST_PROTO_LOCAL_MACRO
  9. # error "local iteration target macro is not defined"
  10. #endif
  11. #ifndef BOOST_PROTO_LOCAL_LIMITS
  12. # define BOOST_PROTO_LOCAL_LIMITS (1, BOOST_PROTO_MAX_ARITY)
  13. #endif
  14. #ifndef BOOST_PROTO_LOCAL_typename_A
  15. # define BOOST_PROTO_LOCAL_typename_A BOOST_PROTO_typename_A
  16. #endif
  17. #ifndef BOOST_PROTO_LOCAL_A
  18. # define BOOST_PROTO_LOCAL_A BOOST_PROTO_A_const_ref
  19. #endif
  20. #ifndef BOOST_PROTO_LOCAL_A_a
  21. # define BOOST_PROTO_LOCAL_A_a BOOST_PROTO_A_const_ref_a
  22. #endif
  23. #ifndef BOOST_PROTO_LOCAL_a
  24. # define BOOST_PROTO_LOCAL_a BOOST_PROTO_ref_a
  25. #endif
  26. #define BOOST_PP_LOCAL_LIMITS BOOST_PROTO_LOCAL_LIMITS
  27. #define BOOST_PP_LOCAL_MACRO(N) \
  28. BOOST_PROTO_LOCAL_MACRO( \
  29. N \
  30. , BOOST_PROTO_LOCAL_typename_A \
  31. , BOOST_PROTO_LOCAL_A \
  32. , BOOST_PROTO_LOCAL_A_a \
  33. , BOOST_PROTO_LOCAL_a \
  34. ) \
  35. /**/
  36. #include BOOST_PP_LOCAL_ITERATE()
  37. #undef BOOST_PROTO_LOCAL_MACRO
  38. #undef BOOST_PROTO_LOCAL_LIMITS
  39. #undef BOOST_PROTO_LOCAL_typename_A
  40. #undef BOOST_PROTO_LOCAL_A
  41. #undef BOOST_PROTO_LOCAL_A_a
  42. #undef BOOST_PROTO_LOCAL_a