OXY API 1.0
OXY API Library Documentation
Loading...
Searching...
No Matches
maybe.hpp File Reference

Maybe type definition for the oxy library. More...

Namespaces

namespace  oxy
 This root namespace contains the common types and operations for the OXY-API library.

Typedefs

template<typename T>
using oxy::maybe = std::optional<T>
 Type alias for representing optional values using std::optional.

Functions

template<typename T>
constexpr auto oxy::just (T x) -> maybe< T >
 Helper function to create a maybe instance containing a value.
constexpr auto oxy::nothing ()
 Helper function to create an empty maybe instance.

Detailed Description

Maybe type definition for the oxy library.

This header defines a maybe type alias using std::optional to represent optional values in the oxy library. It also provides helper functions just and nothing to create instances of maybe. The just function wraps a value in a maybe, while the nothing function returns an empty maybe. This allows for a functional programming style when dealing with optional values.

@license MPL-2.0