4#include "MRPch/MRBindingMacros.h"
5#include "MRPch/MRExpected.h"
11#if MR_USE_STD_EXPECTED || defined(MR_DOT_NET_BUILD)
13template<
class T,
class E = std::
string>
16template<
class E = std::
string>
22 return std::unexpected( std::forward<E>( e ) );
27template<
class T,
class E = std::
string>
30template<
class E = std::
string>
36 return tl::make_unexpected( std::forward<E>( e ) );
44 return "Operation was canceled";
56 return "Unsupported file extension";
68 return "Unsupported file format";
78#define MR_RETURN_IF_UNEXPECTED( expr ) \
79 if ( auto&& res = ( expr ); !res ) \
80 return unexpected( std::move( res.error() ) );
Definition MRCameraOrientationPlugin.h:8
MR_BIND_IGNORE std::string stringUnsupportedFileExtension()
common message about unknown file extension
Definition MRExpected.h:54
MR_BIND_IGNORE auto unexpected(E &&e)
Definition MRExpected.h:34
tl::expected< T, E > Expected
Definition MRExpected.h:28
MR_BIND_IGNORE auto unexpectedUnsupportedFileExtension()
returns Expected error with stringUnsupportedFileExtension()
Definition MRExpected.h:60
MR_BIND_IGNORE auto unexpectedUnsupportedFileFormat()
returns Expected error with stringUnsupportedFileFormat()
Definition MRExpected.h:72
MR_BIND_IGNORE auto unexpectedOperationCanceled()
returns Expected error with stringOperationCanceled()
Definition MRExpected.h:48
tl::unexpected< E > Unexpected
Definition MRExpected.h:31
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:10
MR_BIND_IGNORE std::string stringUnsupportedFileFormat()
common message prefix about unsupported file format
Definition MRExpected.h:66
MR_BIND_IGNORE std::string stringOperationCanceled()
common message about user termination of an operation
Definition MRExpected.h:42