Back to home page

EIC code displayed by LXR

 
 

    


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 // Copyright 2020 Peter Dimov
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // https://www.boost.org/LICENSE_1_0.txt
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 // base_descriptor
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 // bases_descriptor
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 } // namespace detail
0047 } // namespace describe
0048 } // namespace boost
0049 
0050 #endif // #ifndef BOOST_DESCRIBE_DETAIL_BASES_HPP_INCLUDED