is_seq.hpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef BOOST_MPL_AUX_PREPROCESSOR_IS_SEQ_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_PREPROCESSOR_IS_SEQ_HPP_INCLUDED
  3. // Copyright Paul Mensonides 2003
  4. // Copyright Aleksey Gurtovoy 2003-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/preprocessor/seq/size.hpp>
  15. #include <boost/preprocessor/arithmetic/dec.hpp>
  16. #include <boost/preprocessor/punctuation/paren.hpp>
  17. #include <boost/preprocessor/cat.hpp>
  18. #include <boost/preprocessor/config/config.hpp>
  19. // returns 1 if 'seq' is a PP-sequence, 0 otherwise:
  20. //
  21. // BOOST_PP_ASSERT( BOOST_PP_NOT( BOOST_MPL_PP_IS_SEQ( int ) ) )
  22. // BOOST_PP_ASSERT( BOOST_MPL_PP_IS_SEQ( (int) ) )
  23. // BOOST_PP_ASSERT( BOOST_MPL_PP_IS_SEQ( (1)(2) ) )
  24. #if (BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_BCC()) || defined(_MSC_VER) && defined(__INTEL_COMPILER) && __INTEL_COMPILER == 1010
  25. # define BOOST_MPL_PP_IS_SEQ(seq) BOOST_PP_DEC( BOOST_PP_SEQ_SIZE( BOOST_MPL_PP_IS_SEQ_(seq) ) )
  26. # define BOOST_MPL_PP_IS_SEQ_(seq) BOOST_MPL_PP_IS_SEQ_SEQ_( BOOST_MPL_PP_IS_SEQ_SPLIT_ seq )
  27. # define BOOST_MPL_PP_IS_SEQ_SEQ_(x) (x)
  28. # define BOOST_MPL_PP_IS_SEQ_SPLIT_(unused) unused)((unused)
  29. #else
  30. # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
  31. # define BOOST_MPL_PP_IS_SEQ(seq) BOOST_MPL_PP_IS_SEQ_MWCC_((seq))
  32. # define BOOST_MPL_PP_IS_SEQ_MWCC_(args) BOOST_MPL_PP_IS_SEQ_ ## args
  33. # else
  34. # define BOOST_MPL_PP_IS_SEQ(seq) BOOST_MPL_PP_IS_SEQ_(seq)
  35. # endif
  36. # define BOOST_MPL_PP_IS_SEQ_(seq) BOOST_PP_CAT(BOOST_MPL_PP_IS_SEQ_, BOOST_MPL_PP_IS_SEQ_0 seq BOOST_PP_RPAREN())
  37. # define BOOST_MPL_PP_IS_SEQ_0(x) BOOST_MPL_PP_IS_SEQ_1(x
  38. # define BOOST_MPL_PP_IS_SEQ_ALWAYS_0(unused) 0
  39. # define BOOST_MPL_PP_IS_SEQ_BOOST_MPL_PP_IS_SEQ_0 BOOST_MPL_PP_IS_SEQ_ALWAYS_0(
  40. # define BOOST_MPL_PP_IS_SEQ_BOOST_MPL_PP_IS_SEQ_1(unused) 1
  41. #endif
  42. #endif // BOOST_MPL_AUX_PREPROCESSOR_IS_SEQ_HPP_INCLUDED