tesseract++ 0.0.1
N-dimensional tensor library for embedded systems
Loading...
Searching...
No Matches
Classes | Functions
expected.h File Reference

A minimal, STL-free expected/result type for failable operations. More...

#include "simple_type_traits.h"
Include dependency graph for expected.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Unexpected< E >
 Tag type for constructing an Expected in the error state. More...
 
class  Expected< T, E >
 A discriminated union holding either a success value or an error. More...
 

Functions

template<typename E >
 Unexpected (E) -> Unexpected< E >
 Deduction guide: allows Unexpected{MyErrorEnum::SomeError} without specifying the template parameter explicitly.
 

Detailed Description

A minimal, STL-free expected/result type for failable operations.

Modeled after std::expected (C++23) but with no STL dependencies, no exceptions, and no dynamic allocation. Suitable for freestanding and embedded targets.

Uses the library's own simple_type_traits.h for move/forward and a built-in placement new to avoid pulling in any standard headers.

Function Documentation

◆ Unexpected()

template<typename E >
Unexpected ( ) -> Unexpected< E >

Deduction guide: allows Unexpected{MyErrorEnum::SomeError} without specifying the template parameter explicitly.