Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:40

0001 #ifndef BOOST_DESCRIBE_BASES_HPP_INCLUDED
0002 #define BOOST_DESCRIBE_BASES_HPP_INCLUDED
0003 
0004 // Copyright 2020, 2021 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/modifiers.hpp>
0009 #include <boost/describe/detail/void_t.hpp>
0010 #include <boost/describe/detail/config.hpp>
0011 
0012 #if defined(BOOST_DESCRIBE_CXX11)
0013 
0014 #include <boost/mp11/algorithm.hpp>
0015 #include <type_traits>
0016 
0017 namespace boost
0018 {
0019 namespace describe
0020 {
0021 namespace detail
0022 {
0023 
0024 template<class T> using _describe_bases = decltype( boost_base_descriptor_fn( static_cast<T**>(0) ) );
0025 
0026 template<unsigned M> struct base_filter
0027 {
0028     template<class T> using fn = mp11::mp_bool< ( M & mod_any_access & T::modifiers ) != 0 >;
0029 };
0030 
0031 template<class T, class En = void> struct has_describe_bases: std::false_type
0032 {
0033 };
0034 
0035 template<class T> struct has_describe_bases<T, void_t<_describe_bases<T>>>: std::true_type
0036 {
0037 };
0038 
0039 } // namespace detail
0040 
0041 template<class T, unsigned M> using describe_bases = mp11::mp_copy_if_q<detail::_describe_bases<T>, detail::base_filter<M>>;
0042 
0043 template<class T> using has_describe_bases = detail::has_describe_bases<T>;
0044 
0045 } // namespace describe
0046 } // namespace boost
0047 
0048 #endif // !defined(BOOST_DESCRIBE_CXX11)
0049 
0050 #endif // #ifndef BOOST_DESCRIBE_BASES_HPP_INCLUDED