BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslstl_concepts.h
Go to the documentation of this file.
1/// @file bslstl_concepts.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslstl_concepts.h -*-C++-*-
8#ifndef INCLUDED_BSLSTL_CONCEPTS
9#define INCLUDED_BSLSTL_CONCEPTS
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bslstl_concepts bslstl_concepts
15/// @brief Provide functionality of the corresponding C++ Standard header.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslstl
19/// @{
20/// @addtogroup bslstl_concepts
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslstl_concepts-purpose"> Purpose</a>
25/// * <a href="#bslstl_concepts-canonical-header"> Canonical Header </a>
26/// * <a href="#bslstl_concepts-description"> Description </a>
27///
28/// # Purpose {#bslstl_concepts-purpose}
29/// Provide functionality of the corresponding C++ Standard header.
30///
31/// # Canonical Header {#bslstl_concepts-canonical-header}
32/// bsl_concepts.h
33///
34/// # Description {#bslstl_concepts-description}
35/// Provide types, in the `bsl` namespace, equivalent to those
36/// defined in the corresponding C++ standard header. Include the native
37/// compiler-provided standard header, and also directly include Bloomberg's
38/// implementation of the C++ standard type (if one exists). Finally, place the
39/// included symbols from the `std` namespace (if any) into the `bsl` namespace.
40/// @}
41/** @} */
42/** @} */
43
44/** @addtogroup bsl
45 * @{
46 */
47/** @addtogroup bslstl
48 * @{
49 */
50/** @addtogroup bslstl_concepts
51 * @{
52 */
53
54#include <bsls_libraryfeatures.h>
55
56/// To support code that worked with earlier releases of BDE, we test directly
57/// for the presence of the native platform library concepts rather than for
58/// the `BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS` macro that has a dependency
59/// on `BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE`. The library features header
60/// performs the necessary include magic to ensure that the native library
61/// feature macros are available so we deliberately avoid repeating that
62/// non-trivial logic here, which is technically relying on a transitive
63/// header dependency.
64#if defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L
65
66#include <concepts>
67
68namespace bsl {
69 // Import selected symbols into bsl namespace
70
71 // language-related concepts
72 using std::same_as;
73 using std::derived_from;
74 using std::convertible_to;
75 using std::common_reference_with;
76 using std::common_with;
77 using std::integral;
78 using std::signed_integral;
79 using std::unsigned_integral;
80 using std::floating_point;
81 using std::assignable_from;
82 using std::swappable;
83 using std::swappable_with;
84 using std::destructible;
85 using std::constructible_from;
86 using std::default_initializable;
87 using std::move_constructible;
88 using std::copy_constructible;
89
90 // comparison concepts
91 using std::equality_comparable;
92 using std::equality_comparable_with;
93 using std::totally_ordered;
94 using std::totally_ordered_with;
95
96 // object concepts
97 using std::movable;
98 using std::copyable;
99 using std::semiregular;
100 using std::regular;
101
102 // callable concepts
103 using std::invocable;
104 using std::regular_invocable;
105 using std::predicate;
106 using std::relation;
107 using std::equivalence_relation;
108 using std::strict_weak_order;
109
110} // close package namespace
111
112#endif // BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
113
114#endif
115
116// ----------------------------------------------------------------------------
117// Copyright 2025 Bloomberg Finance L.P.
118//
119// Licensed under the Apache License, Version 2.0 (the "License");
120// you may not use this file except in compliance with the License.
121// You may obtain a copy of the License at
122//
123// http://www.apache.org/licenses/LICENSE-2.0
124//
125// Unless required by applicable law or agreed to in writing, software
126// distributed under the License is distributed on an "AS IS" BASIS,
127// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
128// See the License for the specific language governing permissions and
129// limitations under the License.
130// ----------------------------- END-OF-FILE ----------------------------------
131
132/** @} */
133/** @} */
134/** @} */
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlat_valuetypefunctions.h:939