JSON Voorhees
Killer JSON for C++
optional.hpp File Reference

Pulls in an implementation of optional. More...

#include <jsonv/config.hpp>

Go to the source code of this file.

Macros

#define JSONV_OPTIONAL_USE_STD   0
 Set this to 1 to use std::optional as the backing type for jsonv::optional.
 
#define JSONV_OPTIONAL_USE_STD_EXPERIMENTAL   0
 Set this to 1 to use std::experimental::optional as the backing type for jsonv::optional.
 
#define JSONV_OPTIONAL_USE_BOOST   0
 Set this to 1 to use boost::optional as the backing type for jsonv::optional.
 
#define JSONV_OPTIONAL_USE_STD_EXPERIMENTAL   1
 Set this to 1 to use std::experimental::optional as the backing type for jsonv::optional.
 
#define JSONV_OPTIONAL_TYPE   std::experimental::optional
 The type to use for jsonv::optional. More...
 
#define JSONV_NULLOPT_VALUE   std::experimental::nullopt
 The value to use for jsonv::nullopt By default, this is std::nullopt or std::experimental::nullopt (by the same rules as JSONV_OPTIONAL_TYPE). More...
 
#define JSONV_OPTIONAL_INCLUDE   <experimental/optional>
 The file to include to get the implementation for optional. More...
 

Typedefs

template<typename T >
using jsonv::optional = JSONV_OPTIONAL_TYPE< T >
 Represents a value that may or may not be present. More...
 

Detailed Description

Pulls in an implementation of optional.

Copyright (c) 2016 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.

Author
Travis Gockel (travi.nosp@m.s@go.nosp@m.ckelh.nosp@m.ut.c.nosp@m.om)

Definition in file optional.hpp.

Macro Definition Documentation

#define JSONV_NULLOPT_VALUE   std::experimental::nullopt

The value to use for jsonv::nullopt By default, this is std::nullopt or std::experimental::nullopt (by the same rules as JSONV_OPTIONAL_TYPE).

If you define JSONV_OPTIONAL_TYPE, you must also define this.

Definition at line 64 of file optional.hpp.

#define JSONV_OPTIONAL_INCLUDE   <experimental/optional>

The file to include to get the implementation for optional.

If you define JSONV_OPTIONAL_TYPE, you must also define this.

Definition at line 65 of file optional.hpp.

#define JSONV_OPTIONAL_TYPE   std::experimental::optional

The type to use for jsonv::optional.

By default, this is std::optional or std::experimental::optional, depending on the C++ language version you are compiling with.

Definition at line 63 of file optional.hpp.

Typedef Documentation

template<typename T >
using jsonv::optional = typedef JSONV_OPTIONAL_TYPE<T>

Represents a value that may or may not be present.

See also
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3442.html

Definition at line 87 of file optional.hpp.