123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #ifndef BOOST_UTILITY_BASE_FROM_MEMBER_HPP
- #define BOOST_UTILITY_BASE_FROM_MEMBER_HPP
- #include <boost/preprocessor/arithmetic/inc.hpp>
- #include <boost/preprocessor/repetition/enum_binary_params.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/repeat_from_to.hpp>
- #ifndef BOOST_BASE_FROM_MEMBER_MAX_ARITY
- #define BOOST_BASE_FROM_MEMBER_MAX_ARITY 10
- #endif
- #define BOOST_PRIVATE_CTR_DEF( z, n, data ) \
- template < BOOST_PP_ENUM_PARAMS(n, typename T) > \
- explicit base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \
- : member( BOOST_PP_ENUM_PARAMS(n, x) ) \
- {} \
-
- namespace boost
- {
- template < typename MemberType, int UniqueID = 0 >
- class base_from_member
- {
- protected:
- MemberType member;
- base_from_member()
- : member()
- {}
- BOOST_PP_REPEAT_FROM_TO( 1, BOOST_PP_INC(BOOST_BASE_FROM_MEMBER_MAX_ARITY),
- BOOST_PRIVATE_CTR_DEF, _ )
- };
- }
- #undef BOOST_PRIVATE_CTR_DEF
- #endif
|