12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #ifndef BOOST_OUTCOME_POLICY_TERMINATE_HPP
- #define BOOST_OUTCOME_POLICY_TERMINATE_HPP
- #include "base.hpp"
- #include <cstdlib>
- BOOST_OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
- namespace policy
- {
-
- struct terminate : base
- {
- template <class Impl> static constexpr void wide_value_check(Impl &&self)
- {
- if(!base::_has_value(static_cast<Impl &&>(self)))
- {
- std::abort();
- }
- }
- template <class Impl> static constexpr void wide_error_check(Impl &&self) noexcept
- {
- if(!base::_has_error(static_cast<Impl &&>(self)))
- {
- std::abort();
- }
- }
- template <class Impl> static constexpr void wide_exception_check(Impl &&self)
- {
- if(!base::_has_exception(static_cast<Impl &&>(self)))
- {
- std::abort();
- }
- }
- };
- }
- BOOST_OUTCOME_V2_NAMESPACE_END
- #endif
|