// examples/demo_algorithm.hpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #ifndef INCLUDED_EXAMPLES_DEMO_ALGORITHM #define INCLUDED_EXAMPLES_DEMO_ALGORITHM #if defined(__GNUC__) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wmissing-braces" # pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif #if defined(__clang__) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wunknown-warning-option" # pragma clang diagnostic ignored "-Wmissing-braces" #endif #include #include #include #include #include #include #include #include #if 202202L <= __cpp_lib_expected # include #endif // ---------------------------------------------------------------------------- namespace demo { namespace ex = ::beman::net29::detail::ex; } namespace demo::detail { template struct into_error_transform_helper { using type = T; }; template struct into_error_transform_helper { using type = ex::set_error_t(decltype(::std::declval()(::std::declval()...))); }; template struct into_error_transform { template using type = typename into_error_transform_helper::type; }; template struct variant_from_list; template struct variant_from_list> { using type = ex::detail::variant_or_empty; }; template struct variant_from_list> { using type = ex::detail::variant_or_empty; }; template using variant_from_list_t = typename variant_from_list::type; template struct is_set_error { static constexpr bool value{false}; }; template struct is_set_error { static constexpr bool value{true}; }; template struct is_set_value { static constexpr bool value{false}; }; template struct is_set_value { static constexpr bool value{true}; }; template struct decayed_set_value; template struct decayed_set_value { using type = ::std::tuple<::std::decay_t...>; }; template using decayed_set_value_t = typename decayed_set_value::type; template struct decayed_tuple_or_single { using type = ::std::tuple<::std::decay_t...>; }; template struct decayed_tuple_or_single { using type = ::std::decay_t; }; template using decayed_tuple_or_single_t = typename decayed_tuple_or_single::type; template struct make_type_list; template