summaryrefslogtreecommitdiffhomepage
path: root/vendor/toml++/impl/std_optional.hpp
blob: 6e988b517b8f5708abb248daac23daaa59ba7273 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// # This file is a part of toml++ and is subject to the the terms of the MIT license.
// # Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
// # See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
//  SPDX-License-Identifier: MIT
#pragma once

#include "preprocessor.hpp"
TOML_DISABLE_WARNINGS;
#if !TOML_HAS_CUSTOM_OPTIONAL_TYPE
#include <optional>
#endif
TOML_ENABLE_WARNINGS;

TOML_NAMESPACE_START {
#if TOML_HAS_CUSTOM_OPTIONAL_TYPE

  template <typename T>
  using optional = TOML_OPTIONAL_TYPE<T>;

#else

  /// \brief	The 'optional' type used throughout the library.
  ///
  /// \remarks By default this will be an alias for std::optional, but you can change the optional
  /// type 		 used by the library by defining #TOML_OPTIONAL_TYPE.
  template <typename T>
  using optional = std::optional<T>;

#endif
}
TOML_NAMESPACE_END;