MeshLib C++ Docs
Loading...
Searching...
No Matches
MRExpected.h File Reference
#include "MRMeshFwd.h"
#include "MRPch/MRBindingMacros.h"
#include "MRPch/MRExpected.h"
#include <string>

Go to the source code of this file.

Namespaces

namespace  MR
 

Macros

#define MR_RETURN_IF_UNEXPECTED(expr)
 Exits the current function with an error if the given expression contains an error.
 

Typedefs

template<class T , class E = std::string>
using MR::Expected = tl::expected<T, E>
 

Functions

template<class E >
MR_BIND_IGNORE auto MR::unexpected (E &&e)
 
MR_BIND_IGNORE std::string MR::stringOperationCanceled ()
 common message about user termination of an operation
 
MR_BIND_IGNORE auto MR::unexpectedOperationCanceled ()
 returns Expected error with stringOperationCanceled()
 
MR_BIND_IGNORE std::string MR::stringUnsupportedFileExtension ()
 common message about unknown file extension
 
MR_BIND_IGNORE auto MR::unexpectedUnsupportedFileExtension ()
 returns Expected error with stringUnsupportedFileExtension()
 

Macro Definition Documentation

◆ MR_RETURN_IF_UNEXPECTED

#define MR_RETURN_IF_UNEXPECTED ( expr)
Value:
if ( auto&& res = ( expr ); !res ) \
return unexpected( std::move( res.error() ) );

Exits the current function with an error if the given expression contains an error.