BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlb_nullopt.h
Go to the documentation of this file.
1/// @file bdlb_nullopt.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bdlb_nullopt.h -*-C++-*-
8#ifndef INCLUDED_BDLB_NULLOPT
9#define INCLUDED_BDLB_NULLOPT
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bdlb_nullopt bdlb_nullopt
15/// @brief Provide a tag type and constant indicating an empty nullable value.
16/// @addtogroup bdl
17/// @{
18/// @addtogroup bdlb
19/// @{
20/// @addtogroup bdlb_nullopt
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bdlb_nullopt-purpose"> Purpose</a>
25/// * <a href="#bdlb_nullopt-classes"> Classes </a>
26/// * <a href="#bdlb_nullopt-description"> Description </a>
27///
28/// # Purpose {#bdlb_nullopt-purpose}
29/// Provide a tag type and constant indicating an empty nullable value.
30///
31/// @deprecated use `bsl::nullopt_t` from `bsl_optional.h` instead.
32///
33/// # Classes {#bdlb_nullopt-classes}
34///
35/// - NullOptType: tag type representing an empty nullable value
36/// - nullOpt: literal value of type `NullOptType`
37///
38/// @see bsl::optional
39///
40/// # Description {#bdlb_nullopt-description}
41/// This component provides a class, `bdlb::NullOptType`, that
42/// is a synonym for `bsl::nullopt_t`.
43///
44/// In addition to the `NullOptType` class type, this component defines a
45/// constant, `bdlb::nullOpt`, of type `NullOptType`, which is a synonym for
46/// `bsl::nullopt`.
47///
48/// Please use `bsl::nullopt_t` and `bsl::nullopt` instead of
49/// `bdlb::NullOptType` and `bdlb::nullOpt`, respectively.
50///
51/// @}
52/** @} */
53/** @} */
54
55/** @addtogroup bdl
56 * @{
57 */
58/** @addtogroup bdlb
59 * @{
60 */
61/** @addtogroup bdlb_nullopt
62 * @{
63 */
64
65#include <bslscm_version.h>
66
69#include <bsls_keyword.h>
70
71#include <bsl_optional.h>
72
73
74namespace bdlb {
75
76 // =================
77 // class NullOptType
78 // =================
79
80/// This `class` provides an empty tag type so that `bdlb::NullableValue`
81/// can be explicitly constructed in or assigned to an empty state. There
82/// are no publicly accessible constructors for this type other than the
83/// copy constructor. In particular, it is not default constructible, nor
84/// list-initializable in C++11.
85BSLS_DEPRECATE_FEATURE("bdl", "NullOptType", "Use 'bsl::nullopt_t' instead")
86typedef bsl::nullopt_t NullOptType;
87
88/// Value of type `NullOptType` that serves as a literal value for the empty
89/// state of any nullable value.
90#if defined(BSLS_COMPILERFEATURES_SUPPORT_INLINE_VARIABLES)
91inline constexpr bsl::nullopt_t nullOpt = bsl::nullopt;
92#else
93extern const bsl::nullopt_t nullOpt;
94#endif
95
96// ============================================================================
97// TEMPLATE AND INLINE FUNCTION DEFINITIONS
98// ============================================================================
99
100} // close package namespace
101
102
103#endif // ! defined(INCLUDED_BDLB_NULLOPT)
104
105// ----------------------------------------------------------------------------
106// Copyright 2019 Bloomberg Finance L.P.
107//
108// Licensed under the Apache License, Version 2.0 (the "License");
109// you may not use this file except in compliance with the License.
110// You may obtain a copy of the License at
111//
112// http://www.apache.org/licenses/LICENSE-2.0
113//
114// Unless required by applicable law or agreed to in writing, software
115// distributed under the License is distributed on an "AS IS" BASIS,
116// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
117// See the License for the specific language governing permissions and
118// limitations under the License.
119// ----------------------------- END-OF-FILE ----------------------------------
120
121/** @} */
122/** @} */
123/** @} */
#define BSLS_DEPRECATE_FEATURE(UOR, FEATURE, MESSAGE)
Definition bsls_deprecatefeature.h:319
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlb_algorithmworkaroundutil.h:74
const bsl::nullopt_t nullOpt
Definition bdlb_printmethods.h:283
const nullopt_t nullopt
Definition bslstl_optional.h:467