fastlowess-cpp
High-performance LOWESS smoothing
Loading...
Searching...
No Matches
fastlowess::Expected< T > Class Template Reference

A result type that holds either a value or an error. More...

#include <fastlowess.hpp>

Classes

struct  ErrorTag
 

Public Member Functions

 Expected (T val)
 
bool has_value () const
 
 operator bool () const
 
T & value () &
 
const T & value () const &
 
T && value () &&
 
const std::string & error () const
 

Static Public Member Functions

static Expected make_error (std::string msg)
 

Detailed Description

template<typename T>
class fastlowess::Expected< T >

A result type that holds either a value or an error.

Mimics std::expected (C++23) behavior.

Constructor & Destructor Documentation

◆ Expected()

template<typename T >
fastlowess::Expected< T >::Expected ( T  val)
inlineexplicit

Member Function Documentation

◆ error()

template<typename T >
const std::string & fastlowess::Expected< T >::error ( ) const
inline

◆ has_value()

template<typename T >
bool fastlowess::Expected< T >::has_value ( ) const
inline

◆ make_error()

template<typename T >
static Expected fastlowess::Expected< T >::make_error ( std::string  msg)
inlinestatic

◆ operator bool()

template<typename T >
fastlowess::Expected< T >::operator bool ( ) const
inlineexplicit

◆ value() [1/3]

template<typename T >
T & fastlowess::Expected< T >::value ( ) &
inline

◆ value() [2/3]

template<typename T >
T && fastlowess::Expected< T >::value ( ) &&
inline

◆ value() [3/3]

template<typename T >
const T & fastlowess::Expected< T >::value ( ) const &
inline

The documentation for this class was generated from the following file: