is_number.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // (C) Copyright Edward Diener 2011-2015
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. #if !defined(BOOST_VMD_DETAIL_IS_NUMBER_HPP)
  6. #define BOOST_VMD_DETAIL_IS_NUMBER_HPP
  7. #include <boost/preprocessor/control/iif.hpp>
  8. #include <boost/vmd/identity.hpp>
  9. #include <boost/vmd/detail/equal_type.hpp>
  10. #include <boost/vmd/detail/identifier_type.hpp>
  11. #include <boost/vmd/detail/is_identifier.hpp>
  12. #include <boost/vmd/detail/number_registration.hpp>
  13. #define BOOST_VMD_DETAIL_IS_NUMBER_TYPE(vseq) \
  14. BOOST_VMD_DETAIL_EQUAL_TYPE \
  15. ( \
  16. BOOST_VMD_TYPE_NUMBER, \
  17. BOOST_VMD_DETAIL_IDENTIFIER_TYPE(vseq) \
  18. ) \
  19. /**/
  20. #define BOOST_VMD_DETAIL_IS_NUMBER(vseq) \
  21. BOOST_VMD_IDENTITY_RESULT \
  22. ( \
  23. BOOST_PP_IIF \
  24. ( \
  25. BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE(vseq), \
  26. BOOST_VMD_DETAIL_IS_NUMBER_TYPE, \
  27. BOOST_VMD_IDENTITY(0) \
  28. ) \
  29. (vseq) \
  30. ) \
  31. /**/
  32. #endif /* BOOST_VMD_DETAIL_IS_NUMBER_HPP */