File indexing completed on 2025-09-18 08:37:27
0001 #ifndef BOOST_DESCRIBE_DETAIL_BASES_HPP_INCLUDED
0002 #define BOOST_DESCRIBE_DETAIL_BASES_HPP_INCLUDED
0003
0004
0005
0006
0007
0008 #include <boost/describe/detail/compute_base_modifiers.hpp>
0009 #include <boost/describe/detail/pp_for_each.hpp>
0010 #include <boost/describe/detail/list.hpp>
0011 #include <type_traits>
0012
0013 namespace boost
0014 {
0015 namespace describe
0016 {
0017 namespace detail
0018 {
0019
0020
0021 template<class C, class B> struct base_descriptor
0022 {
0023 static_assert( std::is_base_of<B, C>::value, "A type listed as a base is not one" );
0024
0025 using type = B;
0026 static constexpr unsigned modifiers = compute_base_modifiers<C, B>();
0027 };
0028
0029 #ifndef __cpp_inline_variables
0030 template<class C, class B> constexpr unsigned base_descriptor<C, B>::modifiers;
0031 #endif
0032
0033
0034 template<typename ...>
0035 struct bases_descriptor_impl;
0036
0037 template<class C, class ...Bs>
0038 struct bases_descriptor_impl<C, list<Bs...>>
0039 {
0040 using type = list<base_descriptor<C, Bs>...>;
0041 };
0042
0043 #define BOOST_DESCRIBE_BASES(C, ...) inline auto boost_base_descriptor_fn( C** ) \
0044 { return typename boost::describe::detail::bases_descriptor_impl<C, boost::describe::detail::list<__VA_ARGS__>>::type(); }
0045
0046 }
0047 }
0048 }
0049
0050 #endif