Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:43:38

0001 // Copyright (c) 2022 Denis Mikhailov
0002 //
0003 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_PFR_DETAIL_POSSIBLE_REFLECTABLE_HPP
0007 #define BOOST_PFR_DETAIL_POSSIBLE_REFLECTABLE_HPP
0008 #pragma once
0009 
0010 #include <boost/pfr/detail/config.hpp>
0011 #include <boost/pfr/traits_fwd.hpp>
0012 
0013 #include <type_traits> // for std::is_aggregate
0014 
0015 namespace boost { namespace pfr { namespace detail {
0016 
0017 ///////////////////// Returns false when the type exactly wasn't be reflectable
0018 template <class T, class WhatFor>
0019 constexpr decltype(is_reflectable<T, WhatFor>::value) possible_reflectable(long) noexcept {
0020     return is_reflectable<T, WhatFor>::value;
0021 }
0022 
0023 #if BOOST_PFR_ENABLE_IMPLICIT_REFLECTION
0024 
0025 template <class T, class WhatFor>
0026 constexpr bool possible_reflectable(int) noexcept {
0027 #   if  defined(__cpp_lib_is_aggregate)
0028     using type = std::remove_cv_t<T>;
0029     return std::is_aggregate<type>();
0030 #   else
0031     return true;
0032 #   endif
0033 }
0034 
0035 #else
0036 
0037 template <class T, class WhatFor>
0038 constexpr bool possible_reflectable(int) noexcept {
0039     // negative answer here won't change behaviour in PFR-dependent libraries(like Fusion)
0040     return false;
0041 }
0042 
0043 #endif
0044 
0045 }}} // namespace boost::pfr::detail
0046 
0047 #endif // BOOST_PFR_DETAIL_POSSIBLE_REFLECTABLE_HPP
0048 
0049