2 // (C) Copyright Edward Diener 2020
3 // Use, modification and distribution are subject to the Boost Software License,
4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt).
7 #if !defined(BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER_HPP)
8 #define BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER_HPP
10 #include <boost/preprocessor/comparison/equal.hpp>
11 #include <boost/preprocessor/control/iif.hpp>
12 #include <boost/preprocessor/logical/bitor.hpp>
13 #include <boost/preprocessor/punctuation/is_begin_parens.hpp>
14 #include <boost/preprocessor/variadic/size.hpp>
15 #include <boost/preprocessor/variadic/elem.hpp>
16 #include <boost/vmd/identity.hpp>
17 #include <boost/vmd/is_empty.hpp>
18 #include <boost/vmd/detail/identifier_concat.hpp>
20 #define BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER_VSEQ_RESULT(ignored) \
21 BOOST_VMD_IDENTITY_RESULT \
23 BOOST_VMD_IDENTITY(1)(ignored) \
27 #define BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER_VSEQ_ID(vseq) \
28 BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER_VSEQ_RESULT(BOOST_VMD_DETAIL_IDENTIFIER_CONCATENATE(vseq)) \
31 #define BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER_VSEQ(vseq) \
32 BOOST_VMD_IDENTITY_RESULT \
38 BOOST_VMD_IS_EMPTY(vseq), \
39 BOOST_PP_IS_BEGIN_PARENS(vseq) \
41 BOOST_VMD_IDENTITY(0), \
42 BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER_VSEQ_ID \
48 #define BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER_SINGLE(...) \
49 BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER_VSEQ(BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \
52 #define BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER(...) \
53 BOOST_VMD_IDENTITY_RESULT \
57 BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__),1), \
58 BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER_SINGLE, \
59 BOOST_VMD_IDENTITY(0) \
65 #endif /* BOOST_VMD_DETAIL_IS_GENERAL_IDENTIFIER_HPP */