File indexing completed on 2025-09-15 08:44:22
0001
0002
0003
0004
0005
0006 #ifndef BOOST_PFR_DETAIL_UNSAFE_DECLVAL_HPP
0007 #define BOOST_PFR_DETAIL_UNSAFE_DECLVAL_HPP
0008 #pragma once
0009
0010 #include <boost/pfr/detail/config.hpp>
0011
0012 #ifdef BOOST_PFR_HAS_STD_MODULE
0013 import std;
0014 #else
0015 #include <type_traits>
0016 #endif
0017
0018 namespace boost { namespace pfr { namespace detail {
0019
0020
0021
0022 void report_if_you_see_link_error_with_this_function() noexcept;
0023
0024
0025
0026
0027
0028 template <class T>
0029 constexpr T unsafe_declval() noexcept {
0030 report_if_you_see_link_error_with_this_function();
0031
0032 typename std::remove_reference<T>::type* ptr = nullptr;
0033 ptr += 42;
0034 return static_cast<T>(*ptr);
0035 }
0036
0037 }}}
0038
0039
0040 #endif
0041