Zen C++ Libraries
Zero-dependency re-usable components for C++
Loading...
Searching...
No Matches
include
zen
maybe.hpp
1
#ifndef ZEN_OPTIONAL_HPP
2
#define ZEN_OPTIONAL_HPP
3
4
#include <istream>
5
#include <optional>
6
#include <type_traits>
7
8
#include "zen/config.hpp"
9
10
ZEN_NAMESPACE_START
11
12
template
<
typename
T,
typename
Enabler =
void
>
13
struct
derive_maybe
{
14
using
type = std::optional<T>;
15
};
16
17
// TODO Add a specialization for unicode_char that uses EOF as the `std::nullopt` marker.
18
19
template
<
typename
T>
20
using
maybe =
typename
derive_maybe<T>::type;
21
22
ZEN_NAMESPACE_END
23
24
#endif
// #ifndef ZEN_OPTIONAL_HPP
derive_maybe
Definition
maybe.hpp:13
Generated by
1.15.0