@@ -113,11 +113,11 @@ using std::is_object;
113
113
using std::is_scalar;
114
114
using std::is_compound;
115
115
116
+
116
117
// 20.10.4.3, type properties:
117
118
using std::is_trivial;
118
119
using std::is_standard_layout;
119
- using std::is_pod;
120
- using std::is_literal_type;
120
+ using std::is_pod; // deprecated by C++20
121
121
using std::is_abstract;
122
122
using std::is_signed;
123
123
using std::is_unsigned;
@@ -172,19 +172,22 @@ using std::aligned_union;
172
172
#endif
173
173
using std::common_type;
174
174
using std::underlying_type;
175
+
176
+ #if !defined(BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED)
177
+ // These names are removed by C++20
178
+ using std::is_literal_type;
175
179
using std::result_of;
180
+ #endif
176
181
177
182
#ifdef BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES
178
183
template <std::size_t LEN, std::size_t ALIGN>
179
- using aligned_storage_t =
180
- typename std::aligned_storage<LEN, ALIGN>::type;
184
+ using aligned_storage_t = typename std::aligned_storage<LEN, ALIGN>::type;
181
185
// 'aligned_storage_t' is an alias to the return type of the
182
186
// 'std::aligned_storage' meta-function.
183
187
184
188
#ifdef BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES
185
189
template <std::size_t LEN, class ... TYPES>
186
- using aligned_union_t =
187
- typename std::aligned_union<LEN, TYPES...>::type;
190
+ using aligned_union_t = typename std::aligned_union<LEN, TYPES...>::type;
188
191
// 'aligned_union_t' is an alias to the return type of the
189
192
// 'std::aligned_union' meta-function.
190
193
@@ -205,22 +208,24 @@ using make_unsigned_t = typename std::make_unsigned<TYPE>::type;
205
208
// 'std::make_unsigned' meta-function.
206
209
207
210
template <class TYPE >
208
- using remove_all_extents_t =
209
- typename std::remove_all_extents<TYPE>::type;
211
+ using remove_all_extents_t = typename std::remove_all_extents<TYPE>::type;
210
212
// 'remove_all_extents_t' is an alias to the return type of the
211
213
// 'std::remove_all_extents' meta-function.
212
214
213
- template <class TYPE >
214
- using result_of_t = typename std::result_of<TYPE>::type;
215
- // ' result_of_t' is an alias to the return type of the
216
- // 'std::result_of' meta-function.
217
-
218
215
template <class TYPE >
219
216
using underlying_type_t = typename std::underlying_type<TYPE>::type;
220
217
// 'underlying_type_t' is an alias to the return type of the
221
218
// 'std::underlying_type' meta-function.
222
219
#endif
223
220
221
+ #if !defined(BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED)
222
+ // These names are removed by C++20
223
+ template <class TYPE >
224
+ using result_of_t = typename std::result_of<TYPE>::type;
225
+ // ' result_of_t' is an alias to the return type of the
226
+ // 'std::result_of' meta-function.
227
+ # endif
228
+
224
229
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY
225
230
using std::is_null_pointer;
226
231
using std::is_final;
@@ -287,50 +292,24 @@ template <class TYPE>
287
292
BSLS_KEYWORD_INLINE_VARIABLE
288
293
constexpr bool is_standard_layout_v = std::is_standard_layout<TYPE>::value;
289
294
290
- // ----------------------------------------------------------------------------
291
-
292
- #if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \
295
+ # if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \
293
296
BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
294
- #pragma GCC diagnostic push
295
- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
296
- #endif
297
+ # pragma GCC diagnostic push
298
+ # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
299
+ # endif
297
300
298
301
template <class TYPE >
299
- #if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
302
+ # if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
300
303
BSLA_DEPRECATED // Warn of using 'bsl::is_pod_v' even though we suppress
301
304
// warnings of using 'std::is_pod' in this implementation.
302
- #endif // C++20
305
+ # endif // C++20
303
306
BSLS_KEYWORD_INLINE_VARIABLE
304
307
constexpr bool is_pod_v = std::is_pod<TYPE>::value;
305
308
306
- #if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \
309
+ # if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \
307
310
BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
308
- #pragma GCC diagnostic pop
309
- #endif
310
-
311
- // ----------------------------------------------------------------------------
312
-
313
- #if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \
314
- BSLS_COMPILERFEATURES_CPLUSPLUS >= 201703L
315
- #pragma GCC diagnostic push
316
- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
317
- #endif
318
-
319
- #if BSLS_COMPILERFEATURES_CPLUSPLUS < 202002L
320
- template <class TYPE >
321
- BSLA_DEPRECATED // Warn of using 'bsl::is_literal_type' even though we
322
- // suppress warnings of using 'std::is_pod' in this
323
- // implementation.
324
- BSLS_KEYWORD_INLINE_VARIABLE
325
- constexpr bool is_literal_type_v = std::is_literal_type<TYPE>::value;
326
- #else
327
- // Removed in C++20
328
- #endif // Introduced in C++17 already deprecated; removed in C++20.
329
-
330
- #if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \
331
- BSLS_COMPILERFEATURES_CPLUSPLUS >= 201703L
332
- #pragma GCC diagnostic pop
333
- #endif
311
+ # pragma GCC diagnostic pop
312
+ # endif
334
313
335
314
// ----------------------------------------------------------------------------
336
315
@@ -470,7 +449,7 @@ template <class TYPE1, class TYPE2>
470
449
BSLS_KEYWORD_INLINE_VARIABLE
471
450
constexpr bool is_base_of_v = std::is_base_of<TYPE1, TYPE2>::value;
472
451
473
- #ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
452
+ # ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
474
453
template <class ...Bools>
475
454
BSLS_KEYWORD_INLINE_VARIABLE
476
455
constexpr bool conjunction_v = std::conjunction<Bools...>::value;
@@ -529,8 +508,30 @@ template <class TYPE1, class TYPE2>
529
508
BSLS_KEYWORD_INLINE_VARIABLE
530
509
constexpr std::size_t is_nothrow_swappable_with_v =
531
510
std::is_nothrow_swappable_with<TYPE1, TYPE2>::value;
532
- #endif
533
- #endif
511
+ # endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
512
+
513
+ # if (!defined BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED)
514
+ // These names are removed by C++20
515
+ # if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000
516
+ # pragma GCC diagnostic push
517
+ # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
518
+ # endif
519
+
520
+ template <class TYPE >
521
+ BSLA_DEPRECATED // Warn of using 'bsl::is_literal_type' even though we
522
+ // suppress warnings of using 'std::is_pod' in this
523
+ // implementation.
524
+ BSLS_KEYWORD_INLINE_VARIABLE
525
+ constexpr bool is_literal_type_v = std::is_literal_type<TYPE>::value;
526
+
527
+ # if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000
528
+ # pragma GCC diagnostic pop
529
+ # endif
530
+ # endif // BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED
531
+
532
+ #endif // BSLS_COMPILERFEATURES_SUPPORT_VARIABLE_TEMPLATES
533
+
534
+ // ----------------------------------------------------------------------------
534
535
535
536
#if 0
536
537
// These traits are provided by BDE, and have additional members for
@@ -642,7 +643,7 @@ using std::void_t;
642
643
#endif
643
644
644
645
// ----------------------------------------------------------------------------
645
- // Copyright 2019 Bloomberg Finance L.P.
646
+ // Copyright 2022 Bloomberg Finance L.P.
646
647
//
647
648
// Licensed under the Apache License, Version 2.0 (the "License");
648
649
// you may not use this file except in compliance with the License.
0 commit comments