/* A less simple result type
-(C) 2017-2019 Niall Douglas <http://www.nedproductions.biz/> (20 commits)
+(C) 2017-2020 Niall Douglas <http://www.nedproductions.biz/> (20 commits)
File Created: June 2017
BOOST_OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
-template <class R, class S, class P, class NoValuePolicy> //
-BOOST_OUTCOME_REQUIRES(trait::type_can_be_used_in_basic_result<P> && (std::is_void<P>::value || std::is_default_constructible<P>::value)) //
+template <class R, class S, class P, class NoValuePolicy> //
class basic_outcome;
namespace detail
static constexpr bool enable_exception_converting_constructor = //
implicit_constructors_enabled //
&& !is_in_place_type_t<std::decay_t<T>>::value // not in place construction
- && !detail::is_implicitly_constructible<value_type, T> && !detail::is_implicitly_constructible<error_type, T> && detail::is_implicitly_constructible<exception_type, T>;
+ && !detail::is_implicitly_constructible<value_type, T> && !detail::is_implicitly_constructible<error_type, T> &&
+ detail::is_implicitly_constructible<exception_type, T>;
// Predicate for the error + exception converting constructor to be available.
template <class T, class U>
// Predicate for the converting copy constructor from a compatible outcome to be available.
template <class T, class U, class V, class W>
- static constexpr bool enable_compatible_conversion = //
- (std::is_void<T>::value || detail::is_explicitly_constructible<value_type, typename basic_outcome<T, U, V, W>::value_type>) // if our value types are constructible
- &&(std::is_void<U>::value || detail::is_explicitly_constructible<error_type, typename basic_outcome<T, U, V, W>::error_type>) // if our error types are constructible
- &&(std::is_void<V>::value || detail::is_explicitly_constructible<exception_type, typename basic_outcome<T, U, V, W>::exception_type>) // if our exception types are constructible
+ static constexpr bool enable_compatible_conversion = //
+ (std::is_void<T>::value ||
+ detail::is_explicitly_constructible<value_type, typename basic_outcome<T, U, V, W>::value_type>) // if our value types are constructible
+ &&(std::is_void<U>::value ||
+ detail::is_explicitly_constructible<error_type, typename basic_outcome<T, U, V, W>::error_type>) // if our error types are constructible
+ &&(std::is_void<V>::value ||
+ detail::is_explicitly_constructible<exception_type, typename basic_outcome<T, U, V, W>::exception_type>) // if our exception types are constructible
;
// Predicate for the converting constructor from a make_error_code() of the input to be available.
template <class T, class U, class V, class W>
- static constexpr bool enable_make_error_code_compatible_conversion = //
- trait::is_error_code_available<std::decay_t<error_type>>::value // if error type has an error code
- && !enable_compatible_conversion<T, U, V, W> // and the normal compatible conversion is not available
- && (std::is_void<T>::value || detail::is_explicitly_constructible<value_type, typename basic_outcome<T, U, V, W>::value_type>) // and if our value types are constructible
- &&detail::is_explicitly_constructible<error_type, typename trait::is_error_code_available<U>::type> // and our error type is constructible from a make_error_code()
- && (std::is_void<V>::value || detail::is_explicitly_constructible<exception_type, typename basic_outcome<T, U, V, W>::exception_type>); // and our exception types are constructible
+ static constexpr bool enable_make_error_code_compatible_conversion = //
+ trait::is_error_code_available<std::decay_t<error_type>>::value // if error type has an error code
+ && !enable_compatible_conversion<T, U, V, W> // and the normal compatible conversion is not available
+ && (std::is_void<T>::value ||
+ detail::is_explicitly_constructible<value_type, typename basic_outcome<T, U, V, W>::value_type>) // and if our value types are constructible
+ &&detail::is_explicitly_constructible<error_type,
+ typename trait::is_error_code_available<U>::type> // and our error type is constructible from a make_error_code()
+ && (std::is_void<V>::value ||
+ detail::is_explicitly_constructible<exception_type, typename basic_outcome<T, U, V, W>::exception_type>); // and our exception types are constructible
// Predicate for the implicit converting inplace constructor from a compatible input to be available.
struct disable_inplace_value_error_exception_constructor;
template <class... Args>
- using choose_inplace_value_error_exception_constructor = std::conditional_t< //
- ((static_cast<int>(std::is_constructible<value_type, Args...>::value) + static_cast<int>(std::is_constructible<error_type, Args...>::value) + static_cast<int>(std::is_constructible<exception_type, Args...>::value)) > 1), //
- disable_inplace_value_error_exception_constructor, //
- std::conditional_t< //
- std::is_constructible<value_type, Args...>::value, //
- value_type, //
- std::conditional_t< //
- std::is_constructible<error_type, Args...>::value, //
- error_type, //
- std::conditional_t< //
- std::is_constructible<exception_type, Args...>::value, //
- exception_type, //
+ using choose_inplace_value_error_exception_constructor = std::conditional_t< //
+ ((static_cast<int>(std::is_constructible<value_type, Args...>::value) + static_cast<int>(std::is_constructible<error_type, Args...>::value) +
+ static_cast<int>(std::is_constructible<exception_type, Args...>::value)) > 1), //
+ disable_inplace_value_error_exception_constructor, //
+ std::conditional_t< //
+ std::is_constructible<value_type, Args...>::value, //
+ value_type, //
+ std::conditional_t< //
+ std::is_constructible<error_type, Args...>::value, //
+ error_type, //
+ std::conditional_t< //
+ std::is_constructible<exception_type, Args...>::value, //
+ exception_type, //
disable_inplace_value_error_exception_constructor>>>>;
template <class... Args>
static constexpr bool enable_inplace_value_error_exception_constructor = //
- implicit_constructors_enabled && !std::is_same<choose_inplace_value_error_exception_constructor<Args...>, disable_inplace_value_error_exception_constructor>::value;
+ implicit_constructors_enabled &&
+ !std::is_same<choose_inplace_value_error_exception_constructor<Args...>, disable_inplace_value_error_exception_constructor>::value;
};
// Select whether to use basic_outcome_failure_observers or not
template <class Base, class R, class S, class P, class NoValuePolicy>
using select_basic_outcome_failure_observers = //
- std::conditional_t<trait::is_error_code_available<S>::value && trait::is_exception_ptr_available<P>::value, basic_outcome_failure_observers<Base, R, S, P, NoValuePolicy>, Base>;
+ std::conditional_t<trait::is_error_code_available<S>::value && trait::is_exception_ptr_available<P>::value,
+ basic_outcome_failure_observers<Base, R, S, P, NoValuePolicy>, Base>;
template <class T, class U, class V> constexpr inline const V &extract_exception_from_failure(const failure_type<U, V> &v) { return v.exception(); }
- template <class T, class U, class V> constexpr inline V &&extract_exception_from_failure(failure_type<U, V> &&v) { return static_cast<failure_type<U, V> &&>(v).exception(); }
+ template <class T, class U, class V> constexpr inline V &&extract_exception_from_failure(failure_type<U, V> &&v)
+ {
+ return static_cast<failure_type<U, V> &&>(v).exception();
+ }
template <class T, class U> constexpr inline const U &extract_exception_from_failure(const failure_type<U, void> &v) { return v.error(); }
- template <class T, class U> constexpr inline U &&extract_exception_from_failure(failure_type<U, void> &&v) { return static_cast<failure_type<U, void> &&>(v).error(); }
+ template <class T, class U> constexpr inline U &&extract_exception_from_failure(failure_type<U, void> &&v)
+ {
+ return static_cast<failure_type<U, void> &&>(v).error();
+ }
template <class T> struct is_basic_outcome
{
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
- template <class T, class U, class... Args> constexpr inline void hook_outcome_in_place_construction(T * /*unused*/, in_place_type_t<U> /*unused*/, Args &&... /*unused*/) noexcept {}
+ template <class T, class U, class... Args>
+ constexpr inline void hook_outcome_in_place_construction(T * /*unused*/, in_place_type_t<U> /*unused*/, Args &&... /*unused*/) noexcept
+ {
+ }
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
- template <class R, class S, class P, class NoValuePolicy, class U> constexpr inline void override_outcome_exception(basic_outcome<R, S, P, NoValuePolicy> *o, U &&v) noexcept;
+ template <class R, class S, class P, class NoValuePolicy, class U>
+ constexpr inline void override_outcome_exception(basic_outcome<R, S, P, NoValuePolicy> *o, U &&v) noexcept;
} // namespace hooks
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition template <class R, class S, class P, class NoValuePolicy> basic_outcome. Potential doc page: `basic_outcome<T, EC, EP, NoValuePolicy>`
*/
-template <class R, class S, class P, class NoValuePolicy> //
-BOOST_OUTCOME_REQUIRES(trait::type_can_be_used_in_basic_result<P> && (std::is_void<P>::value || std::is_default_constructible<P>::value)) //
+template <class R, class S, class P, class NoValuePolicy> //
class BOOST_OUTCOME_NODISCARD basic_outcome
#if defined(BOOST_OUTCOME_DOXYGEN_IS_IN_THE_HOUSE) || defined(BOOST_OUTCOME_STANDARDESE_IS_IN_THE_HOUSE)
: public detail::basic_outcome_failure_observers<detail::basic_result_final<R, S, P, NoValuePolicy>, R, S, P, NoValuePolicy>,
public detail::basic_outcome_exception_observers<detail::basic_result_final<R, S, NoValuePolicy>, R, S, P, NoValuePolicy>,
public detail::basic_result_final<R, S, NoValuePolicy>
#else
- : public detail::select_basic_outcome_failure_observers<detail::basic_outcome_exception_observers<detail::basic_result_final<R, S, NoValuePolicy>, R, S, P, NoValuePolicy>, R, S, P, NoValuePolicy>
+ : public detail::select_basic_outcome_failure_observers<
+ detail::basic_outcome_exception_observers<detail::basic_result_final<R, S, NoValuePolicy>, R, S, P, NoValuePolicy>, R, S, P, NoValuePolicy>
#endif
{
static_assert(trait::type_can_be_used_in_basic_result<P>, "The exception_type cannot be used");
static_assert(std::is_void<P>::value || std::is_default_constructible<P>::value, "exception_type must be void or default constructible");
- using base = detail::select_basic_outcome_failure_observers<detail::basic_outcome_exception_observers<detail::basic_result_final<R, S, NoValuePolicy>, R, S, P, NoValuePolicy>, R, S, P, NoValuePolicy>;
+ using base = detail::select_basic_outcome_failure_observers<
+ detail::basic_outcome_exception_observers<detail::basic_result_final<R, S, NoValuePolicy>, R, S, P, NoValuePolicy>, R, S, P, NoValuePolicy>;
friend struct policy::base;
- template <class T, class U, class V, class W> //
- BOOST_OUTCOME_REQUIRES(trait::type_can_be_used_in_basic_result<V> && (std::is_void<V>::value || std::is_default_constructible<V>::value)) //
+ template <class T, class U, class V, class W> //
friend class basic_outcome;
- template <class T, class U, class V, class W, class X> friend constexpr inline void hooks::override_outcome_exception(basic_outcome<T, U, V, W> *o, X &&v) noexcept; // NOLINT
+ template <class T, class U, class V, class W, class X>
+ friend constexpr inline void hooks::override_outcome_exception(basic_outcome<T, U, V, W> *o, X &&v) noexcept; // NOLINT
struct implicit_constructors_disabled_tag
{
using base = detail::outcome_predicates<value_type, error_type, exception_type>;
// Predicate for any constructors to be available at all
- static constexpr bool constructors_enabled = (!std::is_same<std::decay_t<value_type>, std::decay_t<error_type>>::value || (std::is_void<value_type>::value && std::is_void<error_type>::value)) //
- && (!std::is_same<std::decay_t<value_type>, std::decay_t<exception_type>>::value || (std::is_void<value_type>::value && std::is_void<exception_type>::value)) //
- && (!std::is_same<std::decay_t<error_type>, std::decay_t<exception_type>>::value || (std::is_void<error_type>::value && std::is_void<exception_type>::value)) //
+ static constexpr bool constructors_enabled =
+ (!std::is_same<std::decay_t<value_type>, std::decay_t<error_type>>::value || (std::is_void<value_type>::value && std::is_void<error_type>::value)) //
+ && (!std::is_same<std::decay_t<value_type>, std::decay_t<exception_type>>::value ||
+ (std::is_void<value_type>::value && std::is_void<exception_type>::value)) //
+ && (!std::is_same<std::decay_t<error_type>, std::decay_t<exception_type>>::value ||
+ (std::is_void<error_type>::value && std::is_void<exception_type>::value)) //
;
// Predicate for implicit constructors to be available at all
static constexpr bool enable_inplace_value_error_exception_constructor = //
constructors_enabled //
&&base::template enable_inplace_value_error_exception_constructor<Args...>;
- template <class... Args> using choose_inplace_value_error_exception_constructor = typename base::template choose_inplace_value_error_exception_constructor<Args...>;
+ template <class... Args>
+ using choose_inplace_value_error_exception_constructor = typename base::template choose_inplace_value_error_exception_constructor<Args...>;
};
public:
- using value_type_if_enabled = std::conditional_t<std::is_same<value_type, error_type>::value || std::is_same<value_type, exception_type>::value, disable_in_place_value_type, value_type>;
- using error_type_if_enabled = std::conditional_t<std::is_same<error_type, value_type>::value || std::is_same<error_type, exception_type>::value, disable_in_place_error_type, error_type>;
- using exception_type_if_enabled = std::conditional_t<std::is_same<exception_type, value_type>::value || std::is_same<exception_type, error_type>::value, disable_in_place_exception_type, exception_type>;
+ using value_type_if_enabled =
+ std::conditional_t<std::is_same<value_type, error_type>::value || std::is_same<value_type, exception_type>::value, disable_in_place_value_type, value_type>;
+ using error_type_if_enabled =
+ std::conditional_t<std::is_same<error_type, value_type>::value || std::is_same<error_type, exception_type>::value, disable_in_place_error_type, error_type>;
+ using exception_type_if_enabled = std::conditional_t<std::is_same<exception_type, value_type>::value || std::is_same<exception_type, error_type>::value,
+ disable_in_place_exception_type, exception_type>;
protected:
detail::devoid<exception_type> _ptr;
*/
BOOST_OUTCOME_TEMPLATE(class T)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED((predicate::constructors_enabled && !predicate::implicit_constructors_enabled //
- && (detail::is_implicitly_constructible<value_type, T> || detail::is_implicitly_constructible<error_type, T> || detail::is_implicitly_constructible<exception_type, T>) )))
- basic_outcome(T && /*unused*/, implicit_constructors_disabled_tag /*unused*/ = implicit_constructors_disabled_tag()) = delete; // NOLINT Implicit constructors disabled, use explicit in_place_type<T>, success() or failure(). see docs!
+ && (detail::is_implicitly_constructible<value_type, T> || detail::is_implicitly_constructible<error_type, T> ||
+ detail::is_implicitly_constructible<exception_type, T>) )))
+ basic_outcome(T && /*unused*/, implicit_constructors_disabled_tag /*unused*/ = implicit_constructors_disabled_tag()) =
+ delete; // NOLINT Implicit constructors disabled, use explicit in_place_type<T>, success() or failure(). see docs!
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
BOOST_OUTCOME_TEMPLATE(class T)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_value_converting_constructor<T>))
- constexpr basic_outcome(T &&t, value_converting_constructor_tag /*unused*/ = value_converting_constructor_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value) // NOLINT
+ constexpr basic_outcome(T &&t, value_converting_constructor_tag /*unused*/ = value_converting_constructor_tag()) noexcept(
+ std::is_nothrow_constructible<value_type, T>::value) // NOLINT
: base{in_place_type<typename base::_value_type>, static_cast<T &&>(t)}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class T)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_error_converting_constructor<T>))
- constexpr basic_outcome(T &&t, error_converting_constructor_tag /*unused*/ = error_converting_constructor_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value) // NOLINT
+ constexpr basic_outcome(T &&t, error_converting_constructor_tag /*unused*/ = error_converting_constructor_tag()) noexcept(
+ std::is_nothrow_constructible<error_type, T>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, static_cast<T &&>(t)}
, _ptr()
{
BOOST_OUTCOME_TEMPLATE(class ErrorCondEnum)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TEXPR(error_type(make_error_code(ErrorCondEnum()))), //
BOOST_OUTCOME_TPRED(predicate::template enable_error_condition_converting_constructor<ErrorCondEnum>))
- constexpr basic_outcome(ErrorCondEnum &&t, error_condition_converting_constructor_tag /*unused*/ = error_condition_converting_constructor_tag()) noexcept(noexcept(error_type(make_error_code(static_cast<ErrorCondEnum &&>(t))))) // NOLINT
+ constexpr basic_outcome(ErrorCondEnum &&t, error_condition_converting_constructor_tag /*unused*/ = error_condition_converting_constructor_tag()) noexcept(
+ noexcept(error_type(make_error_code(static_cast<ErrorCondEnum &&>(t))))) // NOLINT
: base{in_place_type<typename base::_error_type>, make_error_code(t)}
{
using namespace hooks;
*/
BOOST_OUTCOME_TEMPLATE(class T)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_exception_converting_constructor<T>))
- constexpr basic_outcome(T &&t, exception_converting_constructor_tag /*unused*/ = exception_converting_constructor_tag()) noexcept(std::is_nothrow_constructible<exception_type, T>::value) // NOLINT
+ constexpr basic_outcome(T &&t, exception_converting_constructor_tag /*unused*/ = exception_converting_constructor_tag()) noexcept(
+ std::is_nothrow_constructible<exception_type, T>::value) // NOLINT
: base()
, _ptr(static_cast<T &&>(t))
{
using namespace hooks;
- this->_state._status |= detail::status_have_exception;
+ this->_state._status.set_have_exception(true);
hook_outcome_construction(this, static_cast<T &&>(t));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
*/
BOOST_OUTCOME_TEMPLATE(class T, class U)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_error_exception_converting_constructor<T, U>))
- constexpr basic_outcome(T &&a, U &&b, error_exception_converting_constructor_tag /*unused*/ = error_exception_converting_constructor_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value &&std::is_nothrow_constructible<exception_type, U>::value) // NOLINT
+ constexpr basic_outcome(T &&a, U &&b, error_exception_converting_constructor_tag /*unused*/ = error_exception_converting_constructor_tag()) noexcept(
+ std::is_nothrow_constructible<error_type, T>::value &&std::is_nothrow_constructible<exception_type, U>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, static_cast<T &&>(a)}
, _ptr(static_cast<U &&>(b))
{
using namespace hooks;
- this->_state._status |= detail::status_have_exception;
+ this->_state._status.set_have_exception(true);
hook_outcome_construction(this, static_cast<T &&>(a), static_cast<U &&>(b));
}
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(convert::value_or_error<basic_outcome, std::decay_t<T>>::enable_result_inputs || !is_basic_result_v<T>), //
BOOST_OUTCOME_TPRED(convert::value_or_error<basic_outcome, std::decay_t<T>>::enable_outcome_inputs || !is_basic_outcome_v<T>), //
BOOST_OUTCOME_TEXPR(convert::value_or_error<basic_outcome, std::decay_t<T>>{}(std::declval<T>())))
- constexpr explicit basic_outcome(T &&o, explicit_valueorerror_converting_constructor_tag /*unused*/ = explicit_valueorerror_converting_constructor_tag()) // NOLINT
+ constexpr explicit basic_outcome(T &&o,
+ explicit_valueorerror_converting_constructor_tag /*unused*/ = explicit_valueorerror_converting_constructor_tag()) // NOLINT
: basic_outcome{convert::value_or_error<basic_outcome, std::decay_t<T>>{}(static_cast<T &&>(o))}
{
}
*/
BOOST_OUTCOME_TEMPLATE(class T, class U, class V, class W)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_compatible_conversion<T, U, V, W>))
- constexpr explicit basic_outcome(const basic_outcome<T, U, V, W> &o,
- explicit_compatible_copy_conversion_tag /*unused*/ = explicit_compatible_copy_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value &&std::is_nothrow_constructible<exception_type, V>::value)
+ constexpr explicit basic_outcome(
+ const basic_outcome<T, U, V, W> &o,
+ explicit_compatible_copy_conversion_tag /*unused*/ =
+ explicit_compatible_copy_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value
+ &&std::is_nothrow_constructible<exception_type, V>::value)
: base{typename base::compatible_conversion_tag(), o}
, _ptr(o._ptr)
{
*/
BOOST_OUTCOME_TEMPLATE(class T, class U, class V, class W)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_compatible_conversion<T, U, V, W>))
- constexpr explicit basic_outcome(basic_outcome<T, U, V, W> &&o,
- explicit_compatible_move_conversion_tag /*unused*/ = explicit_compatible_move_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value &&std::is_nothrow_constructible<exception_type, V>::value)
+ constexpr explicit basic_outcome(
+ basic_outcome<T, U, V, W> &&o,
+ explicit_compatible_move_conversion_tag /*unused*/ =
+ explicit_compatible_move_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value
+ &&std::is_nothrow_constructible<exception_type, V>::value)
: base{typename base::compatible_conversion_tag(), static_cast<basic_outcome<T, U, V, W> &&>(o)}
, _ptr(static_cast<typename basic_outcome<T, U, V, W>::exception_type &&>(o._ptr))
{
*/
BOOST_OUTCOME_TEMPLATE(class T, class U, class V)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(detail::result_predicates<value_type, error_type>::template enable_compatible_conversion<T, U, V>))
- constexpr explicit basic_outcome(const basic_result<T, U, V> &o,
- explicit_compatible_copy_conversion_tag /*unused*/ = explicit_compatible_copy_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value &&std::is_nothrow_constructible<exception_type>::value)
+ constexpr explicit basic_outcome(
+ const basic_result<T, U, V> &o,
+ explicit_compatible_copy_conversion_tag /*unused*/ =
+ explicit_compatible_copy_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value
+ &&std::is_nothrow_constructible<exception_type>::value)
: base{typename base::compatible_conversion_tag(), o}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class T, class U, class V)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(detail::result_predicates<value_type, error_type>::template enable_compatible_conversion<T, U, V>))
- constexpr explicit basic_outcome(basic_result<T, U, V> &&o,
- explicit_compatible_move_conversion_tag /*unused*/ = explicit_compatible_move_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value &&std::is_nothrow_constructible<exception_type>::value)
+ constexpr explicit basic_outcome(
+ basic_result<T, U, V> &&o,
+ explicit_compatible_move_conversion_tag /*unused*/ =
+ explicit_compatible_move_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value
+ &&std::is_nothrow_constructible<exception_type>::value)
: base{typename base::compatible_conversion_tag(), static_cast<basic_result<T, U, V> &&>(o)}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class T, class U, class V)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(detail::result_predicates<value_type, error_type>::template enable_make_error_code_compatible_conversion<T, U, V>))
- constexpr explicit basic_outcome(const basic_result<T, U, V> &o, explicit_make_error_code_compatible_copy_conversion_tag /*unused*/ = explicit_make_error_code_compatible_copy_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value &&noexcept(make_error_code(std::declval<U>())) &&
- std::is_nothrow_constructible<exception_type>::value)
+ constexpr explicit basic_outcome(const basic_result<T, U, V> &o,
+ explicit_make_error_code_compatible_copy_conversion_tag /*unused*/ =
+ explicit_make_error_code_compatible_copy_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value
+ &&noexcept(make_error_code(std::declval<U>())) &&
+ std::is_nothrow_constructible<exception_type>::value)
: base{typename base::make_error_code_compatible_conversion_tag(), o}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class T, class U, class V)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(detail::result_predicates<value_type, error_type>::template enable_make_error_code_compatible_conversion<T, U, V>))
- constexpr explicit basic_outcome(basic_result<T, U, V> &&o, explicit_make_error_code_compatible_move_conversion_tag /*unused*/ = explicit_make_error_code_compatible_move_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value &&noexcept(make_error_code(std::declval<U>())) &&
- std::is_nothrow_constructible<exception_type>::value)
+ constexpr explicit basic_outcome(basic_result<T, U, V> &&o,
+ explicit_make_error_code_compatible_move_conversion_tag /*unused*/ =
+ explicit_make_error_code_compatible_move_conversion_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value
+ &&noexcept(make_error_code(std::declval<U>())) &&
+ std::is_nothrow_constructible<exception_type>::value)
: base{typename base::make_error_code_compatible_conversion_tag(), static_cast<basic_result<T, U, V> &&>(o)}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class... Args)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_inplace_value_constructor<Args...>))
- constexpr explicit basic_outcome(in_place_type_t<value_type_if_enabled> _, Args &&... args) noexcept(std::is_nothrow_constructible<value_type, Args...>::value)
+ constexpr explicit basic_outcome(in_place_type_t<value_type_if_enabled> _,
+ Args &&... args) noexcept(std::is_nothrow_constructible<value_type, Args...>::value)
: base{_, static_cast<Args &&>(args)...}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class U, class... Args)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_inplace_value_constructor<std::initializer_list<U>, Args...>))
- constexpr explicit basic_outcome(in_place_type_t<value_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<value_type, std::initializer_list<U>, Args...>::value)
+ constexpr explicit basic_outcome(in_place_type_t<value_type_if_enabled> _, std::initializer_list<U> il,
+ Args &&... args) noexcept(std::is_nothrow_constructible<value_type, std::initializer_list<U>, Args...>::value)
: base{_, il, static_cast<Args &&>(args)...}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class... Args)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_inplace_error_constructor<Args...>))
- constexpr explicit basic_outcome(in_place_type_t<error_type_if_enabled> _, Args &&... args) noexcept(std::is_nothrow_constructible<error_type, Args...>::value)
+ constexpr explicit basic_outcome(in_place_type_t<error_type_if_enabled> _,
+ Args &&... args) noexcept(std::is_nothrow_constructible<error_type, Args...>::value)
: base{_, static_cast<Args &&>(args)...}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class U, class... Args)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_inplace_error_constructor<std::initializer_list<U>, Args...>))
- constexpr explicit basic_outcome(in_place_type_t<error_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<error_type, std::initializer_list<U>, Args...>::value)
+ constexpr explicit basic_outcome(in_place_type_t<error_type_if_enabled> _, std::initializer_list<U> il,
+ Args &&... args) noexcept(std::is_nothrow_constructible<error_type, std::initializer_list<U>, Args...>::value)
: base{_, il, static_cast<Args &&>(args)...}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class... Args)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_inplace_exception_constructor<Args...>))
- constexpr explicit basic_outcome(in_place_type_t<exception_type_if_enabled> /*unused*/, Args &&... args) noexcept(std::is_nothrow_constructible<exception_type, Args...>::value)
+ constexpr explicit basic_outcome(in_place_type_t<exception_type_if_enabled> /*unused*/,
+ Args &&... args) noexcept(std::is_nothrow_constructible<exception_type, Args...>::value)
: base()
, _ptr(static_cast<Args &&>(args)...)
{
using namespace hooks;
- this->_state._status |= detail::status_have_exception;
+ this->_state._status.set_have_exception(true);
hook_outcome_in_place_construction(this, in_place_type<exception_type>, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
*/
BOOST_OUTCOME_TEMPLATE(class U, class... Args)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_inplace_exception_constructor<std::initializer_list<U>, Args...>))
- constexpr explicit basic_outcome(in_place_type_t<exception_type_if_enabled> /*unused*/, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<exception_type, std::initializer_list<U>, Args...>::value)
+ constexpr explicit basic_outcome(in_place_type_t<exception_type_if_enabled> /*unused*/, std::initializer_list<U> il,
+ Args &&... args) noexcept(std::is_nothrow_constructible<exception_type, std::initializer_list<U>, Args...>::value)
: base()
, _ptr(il, static_cast<Args &&>(args)...)
{
using namespace hooks;
- this->_state._status |= detail::status_have_exception;
+ this->_state._status.set_have_exception(true);
hook_outcome_in_place_construction(this, in_place_type<exception_type>, il, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
*/
BOOST_OUTCOME_TEMPLATE(class A1, class A2, class... Args)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(predicate::template enable_inplace_value_error_exception_constructor<A1, A2, Args...>))
- constexpr basic_outcome(A1 &&a1, A2 &&a2, Args &&... args) noexcept(noexcept(typename predicate::template choose_inplace_value_error_exception_constructor<A1, A2, Args...>(std::declval<A1>(), std::declval<A2>(), std::declval<Args>()...)))
- : basic_outcome(in_place_type<typename predicate::template choose_inplace_value_error_exception_constructor<A1, A2, Args...>>, static_cast<A1 &&>(a1), static_cast<A2 &&>(a2), static_cast<Args &&>(args)...)
+ constexpr basic_outcome(A1 &&a1, A2 &&a2, Args &&... args) noexcept(
+ noexcept(typename predicate::template choose_inplace_value_error_exception_constructor<A1, A2, Args...>(std::declval<A1>(), std::declval<A2>(),
+ std::declval<Args>()...)))
+ : basic_outcome(in_place_type<typename predicate::template choose_inplace_value_error_exception_constructor<A1, A2, Args...>>, static_cast<A1 &&>(a1),
+ static_cast<A2 &&>(a2), static_cast<Args &&>(args)...)
{
}
*/
BOOST_OUTCOME_TEMPLATE(class T)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_compatible_conversion<void, T, void, void>))
- constexpr basic_outcome(const failure_type<T> &o, error_failure_tag /*unused*/ = error_failure_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value) // NOLINT
+ constexpr basic_outcome(const failure_type<T> &o,
+ error_failure_tag /*unused*/ = error_failure_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, detail::extract_error_from_failure<error_type>(o)}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class T)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_compatible_conversion<void, void, T, void>))
- constexpr basic_outcome(const failure_type<T> &o, exception_failure_tag /*unused*/ = exception_failure_tag()) noexcept(std::is_nothrow_constructible<exception_type, T>::value) // NOLINT
+ constexpr basic_outcome(const failure_type<T> &o, exception_failure_tag /*unused*/ = exception_failure_tag()) noexcept(
+ std::is_nothrow_constructible<exception_type, T>::value) // NOLINT
: base()
, _ptr(detail::extract_exception_from_failure<exception_type>(o))
{
- this->_state._status |= detail::status_have_exception;
+ this->_state._status.set_have_exception(true);
using namespace hooks;
hook_outcome_copy_construction(this, o);
}
*/
BOOST_OUTCOME_TEMPLATE(class T)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_make_error_code_compatible_conversion<void, T, void, void>))
- constexpr basic_outcome(const failure_type<T> &o, explicit_make_error_code_compatible_copy_conversion_tag /*unused*/ = explicit_make_error_code_compatible_copy_conversion_tag()) noexcept(noexcept(make_error_code(std::declval<T>()))) // NOLINT
+ constexpr basic_outcome(const failure_type<T> &o,
+ explicit_make_error_code_compatible_copy_conversion_tag /*unused*/ =
+ explicit_make_error_code_compatible_copy_conversion_tag()) noexcept(noexcept(make_error_code(std::declval<T>()))) // NOLINT
: base{in_place_type<typename base::_error_type>, make_error_code(detail::extract_error_from_failure<error_type>(o))}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class T, class U)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(!std::is_void<U>::value && predicate::template enable_compatible_conversion<void, T, U, void>))
- constexpr basic_outcome(const failure_type<T, U> &o, explicit_compatible_copy_conversion_tag /*unused*/ = explicit_compatible_copy_conversion_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value &&std::is_nothrow_constructible<exception_type, U>::value) // NOLINT
+ constexpr basic_outcome(const failure_type<T, U> &o, explicit_compatible_copy_conversion_tag /*unused*/ = explicit_compatible_copy_conversion_tag()) noexcept(
+ std::is_nothrow_constructible<error_type, T>::value &&std::is_nothrow_constructible<exception_type, U>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, detail::extract_error_from_failure<error_type>(o)}
, _ptr(detail::extract_exception_from_failure<exception_type>(o))
{
if(!o.has_error())
{
- this->_state._status &= ~detail::status_have_error;
+ this->_state._status.set_have_error(false);
}
if(o.has_exception())
{
- this->_state._status |= detail::status_have_exception;
+ this->_state._status.set_have_exception(true);
}
using namespace hooks;
hook_outcome_copy_construction(this, o);
*/
BOOST_OUTCOME_TEMPLATE(class T)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_compatible_conversion<void, T, void, void>))
- constexpr basic_outcome(failure_type<T> &&o, error_failure_tag /*unused*/ = error_failure_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value) // NOLINT
+ constexpr basic_outcome(failure_type<T> &&o,
+ error_failure_tag /*unused*/ = error_failure_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, detail::extract_error_from_failure<error_type>(static_cast<failure_type<T> &&>(o))}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class T)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_compatible_conversion<void, void, T, void>))
- constexpr basic_outcome(failure_type<T> &&o, exception_failure_tag /*unused*/ = exception_failure_tag()) noexcept(std::is_nothrow_constructible<exception_type, T>::value) // NOLINT
+ constexpr basic_outcome(failure_type<T> &&o, exception_failure_tag /*unused*/ = exception_failure_tag()) noexcept(
+ std::is_nothrow_constructible<exception_type, T>::value) // NOLINT
: base()
, _ptr(detail::extract_exception_from_failure<exception_type>(static_cast<failure_type<T> &&>(o)))
{
- this->_state._status |= detail::status_have_exception;
+ this->_state._status.set_have_exception(true);
using namespace hooks;
hook_outcome_copy_construction(this, o);
}
*/
BOOST_OUTCOME_TEMPLATE(class T)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_make_error_code_compatible_conversion<void, T, void, void>))
- constexpr basic_outcome(failure_type<T> &&o, explicit_make_error_code_compatible_move_conversion_tag /*unused*/ = explicit_make_error_code_compatible_move_conversion_tag()) noexcept(noexcept(make_error_code(std::declval<T>()))) // NOLINT
+ constexpr basic_outcome(failure_type<T> &&o,
+ explicit_make_error_code_compatible_move_conversion_tag /*unused*/ =
+ explicit_make_error_code_compatible_move_conversion_tag()) noexcept(noexcept(make_error_code(std::declval<T>()))) // NOLINT
: base{in_place_type<typename base::_error_type>, make_error_code(detail::extract_error_from_failure<error_type>(static_cast<failure_type<T> &&>(o)))}
, _ptr()
{
*/
BOOST_OUTCOME_TEMPLATE(class T, class U)
BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(!std::is_void<U>::value && predicate::template enable_compatible_conversion<void, T, U, void>))
- constexpr basic_outcome(failure_type<T, U> &&o, explicit_compatible_move_conversion_tag /*unused*/ = explicit_compatible_move_conversion_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value &&std::is_nothrow_constructible<exception_type, U>::value) // NOLINT
+ constexpr basic_outcome(failure_type<T, U> &&o, explicit_compatible_move_conversion_tag /*unused*/ = explicit_compatible_move_conversion_tag()) noexcept(
+ std::is_nothrow_constructible<error_type, T>::value &&std::is_nothrow_constructible<exception_type, U>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, detail::extract_error_from_failure<error_type>(static_cast<failure_type<T, U> &&>(o))}
, _ptr(detail::extract_exception_from_failure<exception_type>(static_cast<failure_type<T, U> &&>(o)))
{
if(!o.has_error())
{
- this->_state._status &= ~detail::status_have_error;
+ this->_state._status.set_have_error(false);
}
if(o.has_exception())
{
- this->_state._status |= detail::status_have_exception;
+ this->_state._status.set_have_exception(true);
}
using namespace hooks;
hook_outcome_move_construction(this, static_cast<failure_type<T, U> &&>(o));
&& noexcept(std::declval<detail::devoid<error_type>>() == std::declval<detail::devoid<U>>()) //
&& noexcept(std::declval<detail::devoid<exception_type>>() == std::declval<detail::devoid<V>>()))
{
- if((this->_state._status & detail::status_have_value) != 0 && (o._state._status & detail::status_have_value) != 0)
+ if(this->_state._status.have_value() && o._state._status.have_value())
{
return this->_state._value == o._state._value; // NOLINT
}
- if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0 //
- && (this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
+ if(this->_state._status.have_error() && o._state._status.have_error() //
+ && this->_state._status.have_exception() && o._state._status.have_exception())
{
return this->_error == o._error && this->_ptr == o._ptr;
}
- if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0)
+ if(this->_state._status.have_error() && o._state._status.have_error())
{
return this->_error == o._error;
}
- if((this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
+ if(this->_state._status.have_exception() && o._state._status.have_exception())
{
return this->_ptr == o._ptr;
}
constexpr bool operator==(const failure_type<T, U> &o) const noexcept( //
noexcept(std::declval<error_type>() == std::declval<T>()) && noexcept(std::declval<exception_type>() == std::declval<U>()))
{
- if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0 //
- && (this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
+ if(this->_state._status.have_error() && o._state._status.have_error() //
+ && this->_state._status.have_exception() && o._state._status.have_exception())
{
return this->_error == o.error() && this->_ptr == o.exception();
}
- if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0)
+ if(this->_state._status.have_error() && o._state._status.have_error())
{
return this->_error == o.error();
}
- if((this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
+ if(this->_state._status.have_exception() && o._state._status.have_exception())
{
return this->_ptr == o.exception();
}
&& noexcept(std::declval<detail::devoid<error_type>>() != std::declval<detail::devoid<U>>()) //
&& noexcept(std::declval<detail::devoid<exception_type>>() != std::declval<detail::devoid<V>>()))
{
- if((this->_state._status & detail::status_have_value) != 0 && (o._state._status & detail::status_have_value) != 0)
+ if(this->_state._status.have_value() && o._state._status.have_value())
{
return this->_state._value != o._state._value; // NOLINT
}
- if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0 //
- && (this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
+ if(this->_state._status.have_error() && o._state._status.have_error() //
+ && this->_state._status.have_exception() && o._state._status.have_exception())
{
return this->_error != o._error || this->_ptr != o._ptr;
}
- if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0)
+ if(this->_state._status.have_error() && o._state._status.have_error())
{
return this->_error != o._error;
}
- if((this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
+ if(this->_state._status.have_exception() && o._state._status.have_exception())
{
return this->_ptr != o._ptr;
}
constexpr bool operator!=(const failure_type<T, U> &o) const noexcept( //
noexcept(std::declval<error_type>() == std::declval<T>()) && noexcept(std::declval<exception_type>() == std::declval<U>()))
{
- if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0 //
- && (this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
+ if(this->_state._status.have_error() && o._state._status.have_error() //
+ && this->_state._status.have_exception() && o._state._status.have_exception())
{
return this->_error != o.error() || this->_ptr != o.exception();
}
- if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0)
+ if(this->_state._status.have_error() && o._state._status.have_error())
{
return this->_error != o.error();
}
- if((this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
+ if(this->_state._status.have_exception() && o._state._status.have_exception())
{
return this->_ptr != o.exception();
}
if(!all_good)
{
// We lost one of the values
- a._state._status |= detail::status_lost_consistency;
- b._state._status |= detail::status_lost_consistency;
+ a._state._status.set_have_lost_consistency(true);
+ b._state._status.set_have_lost_consistency(true);
return;
}
if(exceptioned)
catch(...)
{
// We lost one of the values
- a._state._status |= detail::status_lost_consistency;
- b._state._status |= detail::status_lost_consistency;
+ a._state._status.set_have_lost_consistency(true);
+ b._state._status.set_have_lost_consistency(true);
// throw away second exception
}
auto check = [](basic_outcome *t) {
if(t->has_value() && (t->has_error() || t->has_exception()))
{
- t->_state._status &= ~(detail::status_have_error | detail::status_have_exception);
- t->_state._status |= detail::status_lost_consistency;
+ t->_state._status.set_have_error(false).set_have_exception(false);
+ t->_state._status.set_have_lost_consistency(true);
}
if(!t->has_value() && !(t->has_error() || t->has_exception()))
{
// Choose error, for no particular reason
- t->_state._status |= detail::status_have_error | detail::status_lost_consistency;
+ t->_state._status.set_have_error(true).set_have_lost_consistency(true);
}
};
check(&a);
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
- template <class R, class S, class P, class NoValuePolicy, class U> constexpr inline void override_outcome_exception(basic_outcome<R, S, P, NoValuePolicy> *o, U &&v) noexcept
+ template <class R, class S, class P, class NoValuePolicy, class U>
+ constexpr inline void override_outcome_exception(basic_outcome<R, S, P, NoValuePolicy> *o, U &&v) noexcept
{
o->_ptr = static_cast<U &&>(v); // NOLINT
- o->_state._status |= detail::status_have_exception;
+ o->_state._status.set_have_exception(true);
}
} // namespace hooks
BOOST_OUTCOME_V2_NAMESPACE_BEGIN
// Check is trivial in all ways except default constructibility and standard layout
// static_assert(std::is_trivial<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivial!");
-// static_assert(std::is_trivially_default_constructible<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially default constructible!");
+// static_assert(std::is_trivially_default_constructible<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially default
+// constructible!");
static_assert(std::is_trivially_copyable<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially copyable!");
-static_assert(std::is_trivially_assignable<basic_outcome<int, long, double, policy::all_narrow>, basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially assignable!");
+static_assert(std::is_trivially_assignable<basic_outcome<int, long, double, policy::all_narrow>, basic_outcome<int, long, double, policy::all_narrow>>::value,
+ "outcome<int> is not trivially assignable!");
static_assert(std::is_trivially_destructible<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially destructible!");
-static_assert(std::is_trivially_copy_constructible<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially copy constructible!");
-static_assert(std::is_trivially_move_constructible<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially move constructible!");
+static_assert(std::is_trivially_copy_constructible<basic_outcome<int, long, double, policy::all_narrow>>::value,
+ "outcome<int> is not trivially copy constructible!");
+static_assert(std::is_trivially_move_constructible<basic_outcome<int, long, double, policy::all_narrow>>::value,
+ "outcome<int> is not trivially move constructible!");
static_assert(std::is_trivially_copy_assignable<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially copy assignable!");
static_assert(std::is_trivially_move_assignable<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially move assignable!");
// Can't be standard layout as non-static member data is defined in more than one inherited class