4#include "MRPch/MRBindingMacros.h"
7#ifndef MR_USE_STD_EXPECTED
8#if __cpp_lib_expected >= 202211
9#define MR_USE_STD_EXPECTED 1
11#define MR_USE_STD_EXPECTED 0
15#if MR_USE_STD_EXPECTED
18#include <tl/expected.hpp>
21#ifdef MR_DOT_NET_BUILD
24template<
typename T,
typename E>
25class expected :
public tl::expected<T, E>
27 using tl::expected<T, E>::expected;
31inline auto unexpected( E &&e )
33 return tl::make_unexpected( std::forward<E>( e ) );
44#if MR_USE_STD_EXPECTED || defined(MR_DOT_NET_BUILD)
46template<
class T,
class E = std::
string>
47using Expected = std::expected<T, E>;
52 return std::unexpected( std::forward<E>( e ) );
57template<
class T,
class E = std::
string>
63 return tl::make_unexpected( std::forward<E>( e ) );
69using VoidOrErrStr [[deprecated]] = Expected<void>;
74 return "Operation was canceled";
Definition MRCameraOrientationPlugin.h:8
MR_BIND_IGNORE auto unexpected(E &&e)
Definition MRExpected.h:61
tl::expected< T, E > Expected
Definition MRExpected.h:58
MR_BIND_IGNORE auto unexpectedOperationCanceled()
Returns Expected error with stringOperationCanceled()
Definition MRExpected.h:78
MR_BIND_IGNORE std::string stringOperationCanceled()
Common operation canceled line for all.
Definition MRExpected.h:72