|
JSON Voorhees
Killer JSON for C++
|
Pulls in an implementation of optional.
More...
#include <jsonv/config.hpp>#include <memory>#include <optional>#include <type_traits>#include <utility>
Include dependency graph for optional.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Typedefs | |
| template<typename T > | |
| using | jsonv::optional = typename detail::optional_type< T >::type |
| Represents a value that may or may not be present. | |
Pulls in an implementation of optional.
Copyright (c) 2016-2026 by Travis Gockel. All rights reserved.
This program is free software: you can redistribute it and/or modify it under the terms of the Apache License as published by the Apache Software Foundation, either version 2 of the License, or (at your option) any later version.
Definition in file optional.hpp.
| using jsonv::optional = typedef typename detail::optional_type<T>::type |
Represents a value that may or may not be present.
This is std::optional<T> for every T it accepts. A reference is the exception: std::optional of one is ill-formed until C++26 (P2988), and the standard libraries of MSVC and Apple's Clang do not have it yet. Until every toolchain this library supports does, optional<T&> is detail::optional_ref, which behaves as std::optional<T&> does as far as it goes. Once they all do, this is std::optional throughout.
It is chosen by the reference rather than by which standard library is present, so that the library and a program built against it in another language mode agree on what every signature means.
Definition at line 239 of file optional.hpp.