BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslmf_negation.h
Go to the documentation of this file.
1/// @file bslmf_negation.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslmf_negation.h -*-C++-*-
8#ifndef INCLUDED_BSLMF_NEGATION
9#define INCLUDED_BSLMF_NEGATION
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bslmf_negation bslmf_negation
15/// @brief Provide the logical negation (NOT) for type traits.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslmf
19/// @{
20/// @addtogroup bslmf_negation
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslmf_negation-purpose"> Purpose</a>
25/// * <a href="#bslmf_negation-classes"> Classes </a>
26/// * <a href="#bslmf_negation-description"> Description </a>
27///
28/// # Purpose {#bslmf_negation-purpose}
29/// Provide the logical negation (NOT) for type traits.
30///
31/// # Classes {#bslmf_negation-classes}
32///
33/// - bsl::negation: forms the logical NOT of the specified type trait
34/// - bsl::negation_v: the result value of the `negation` meta-function
35///
36/// # Description {#bslmf_negation-description}
37/// This component makes available the functionality provided by
38/// the `std::negation` meta-function in all C++ language modes -
39/// `std::negation` is available only starting from C++17.
40/// @}
41/** @} */
42/** @} */
43
44/** @addtogroup bsl
45 * @{
46 */
47/** @addtogroup bslmf
48 * @{
49 */
50/** @addtogroup bslmf_negation
51 * @{
52 */
53
54#include <bslscm_version.h>
55
57#include <bsls_keyword.h>
59
60#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
61#include <type_traits>
62#else
63#include <bslmf_conditional.h>
65#endif
66
67namespace bsl {
68
69#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
70
71using std::negation;
72using std::negation_v;
73
74#else
75
76 // ===============
77 // struct negation
78 // ===============
79
80template <class B>
81struct negation : integral_constant<bool, !bool(B::value)> {
82};
83
84#ifdef BSLS_COMPILERFEATURES_SUPPORT_VARIABLE_TEMPLATES
85template <class B>
86BSLS_KEYWORD_INLINE_VARIABLE constexpr bool negation_v = negation<B>::value;
87#endif
88
89#endif
90
91} // close namespace bsl
92
93#endif
94
95// ----------------------------------------------------------------------------
96// Copyright 2024 Bloomberg Finance L.P.
97//
98// Licensed under the Apache License, Version 2.0 (the "License");
99// you may not use this file except in compliance with the License.
100// You may obtain a copy of the License at
101//
102// http://www.apache.org/licenses/LICENSE-2.0
103//
104// Unless required by applicable law or agreed to in writing, software
105// distributed under the License is distributed on an "AS IS" BASIS,
106// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
107// See the License for the specific language governing permissions and
108// limitations under the License.
109// ----------------------------- END-OF-FILE ----------------------------------
110
111/** @} */
112/** @} */
113/** @} */
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_INLINE_VARIABLE
Definition bsls_keyword.h:623
Definition bdlb_printmethods.h:283
Definition bslmf_integralconstant.h:244
Definition bslmf_negation.h:81