2 // Copyright (C) 2009-2012 Lorenzo Caminiti
3 // Distributed under the Boost Software License, Version 1.0
4 // (see accompanying file LICENSE_1_0.txt or a copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 // Home at http://www.boost.org/libs/local_function
8 #ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_THIS_COUNT_HPP_
9 #define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_THIS_COUNT_HPP_
11 #include <boost/local_function/aux_/preprocessor/traits/decl_/set_error.hpp>
12 #include <boost/local_function/aux_/preprocessor/traits/decl_const_binds.hpp>
13 #include <boost/local_function/aux_/preprocessor/traits/decl_binds.hpp>
14 #include <boost/preprocessor/control/iif.hpp>
15 #include <boost/preprocessor/facilities/empty.hpp>
16 #include <boost/preprocessor/tuple/eat.hpp>
17 #include <boost/preprocessor/comparison/greater.hpp>
18 #include <boost/preprocessor/list/append.hpp>
19 #include <boost/preprocessor/list/size.hpp>
23 #define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_THIS_COUNT( \
25 BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_LIST_SIZE(BOOST_PP_LIST_APPEND( \
26 BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
28 BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES( \
31 BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SET_ERROR \
32 , /* do nothing (keeping previous error, if any) */ \
33 decl_traits BOOST_PP_TUPLE_EAT(2) \
34 )(decl_traits, /* trailing `EMPTY` because error might not be present */ \
35 ERROR_cannot_bind_object_this_multiple_times BOOST_PP_EMPTY)
37 #endif // #include guard