// Copyright (c) 2022 Denis Mikhailov // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PFR_DETAIL_POSSIBLE_REFLECTABLE_HPP #define BOOST_PFR_DETAIL_POSSIBLE_REFLECTABLE_HPP #pragma once #include #include #include // for std::is_aggregate namespace boost { namespace pfr { namespace detail { ///////////////////// Returns false when the type exactly wasn't be reflectable template constexpr decltype(is_reflectable::value) possible_reflectable(long) noexcept { return is_reflectable::value; } #if BOOST_PFR_ENABLE_IMPLICIT_REFLECTION template constexpr bool possible_reflectable(int) noexcept { # if defined(__cpp_lib_is_aggregate) using type = std::remove_cv_t; return std::is_aggregate(); # else return true; # endif } #else template constexpr bool possible_reflectable(int) noexcept { // negative answer here won't change behaviour in PFR-dependent libraries(like Fusion) return false; } #endif }}} // namespace boost::pfr::detail #endif // BOOST_PFR_DETAIL_POSSIBLE_REFLECTABLE_HPP