File indexing completed on 2025-01-30 09:49:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef BOOST_OUTCOME_POLICY_FAIL_TO_COMPILE_OBSERVERS_HPP
0032 #define BOOST_OUTCOME_POLICY_FAIL_TO_COMPILE_OBSERVERS_HPP
0033
0034 #include "base.hpp"
0035
0036 BOOST_OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
0037
0038 #define BOOST_OUTCOME_FAIL_TO_COMPILE_OBSERVERS_MESSAGE \
0039 "Attempt to wide observe value, error or " \
0040 "exception for a basic_result/basic_outcome given an EC or EP type which is not void, and for whom " \
0041 "trait::is_error_code_available<EC>, trait::is_exception_ptr_available<EC>, and trait::is_exception_ptr_available<EP> " \
0042 "are all false. Please specify a NoValuePolicy to tell basic_result/basic_outcome what to do, or else use " \
0043 "a more specific convenience type alias such as unchecked<T, E> to indicate you want the wide " \
0044 "observers to be narrow, or checked<T, E> to indicate you always want an exception throw etc."
0045
0046 namespace policy
0047 {
0048 struct fail_to_compile_observers : base
0049 {
0050 template <class Impl> static constexpr void wide_value_check(Impl && ) { static_assert(!std::is_same<Impl, Impl>::value, BOOST_OUTCOME_FAIL_TO_COMPILE_OBSERVERS_MESSAGE); }
0051 template <class Impl> static constexpr void wide_error_check(Impl && ) { static_assert(!std::is_same<Impl, Impl>::value, BOOST_OUTCOME_FAIL_TO_COMPILE_OBSERVERS_MESSAGE); }
0052 template <class Impl> static constexpr void wide_exception_check(Impl && ) { static_assert(!std::is_same<Impl, Impl>::value, BOOST_OUTCOME_FAIL_TO_COMPILE_OBSERVERS_MESSAGE); }
0053 };
0054 }
0055
0056 #undef BOOST_OUTCOME_FAIL_TO_COMPILE_OBSERVERS_MESSAGE
0057
0058 BOOST_OUTCOME_V2_NAMESPACE_END
0059
0060 #endif