Skip to content

Commit 2fd9859

Browse files
committed
Use std::void_t rather than shipping another one
stdc::void_t was a template alias of the kind that exists to make SFINAE work, and C++17 has it in <type_traits>, which algorithms.h already includes. The two traits that used it use the standard one now and the alias is gone, which takes it out of the documentation as a consequence rather than by hiding it. Hiding it was the first attempt, and worth recording why it did not work. It went in EXCLUDE_SYMBOLS, the containers topic page still showed it, and the reason I did not notice is that I read the Classes list, where a template alias is not: it was under Typedefs. Reading the list to the end would have said so. Windows 371, Linux 366, docs clean.
1 parent d42b1e5 commit 2fd9859

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎cmake/doxygen.cmake‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ SORT_MEMBER_DOCS = NO
8888
# is read as two patterns, and the second one matched enough to leave the index with nothing in
8989
# it at all. Silently, and with no warning from Doxygen. Hence *enable_if* here, which names the
9090
# same two specializations without a space.
91-
EXCLUDE_SYMBOLS = *::detail *::detail::* stdc::str::conv* *enable_if* stdc::is_map stdc::has_key_type* stdc::has_mapped_type* stdc::void_t stdc::vlarray_base stdc::flag stdc::incompatible_flag stdc::winapi::kernel32 stdc::winapi::user32
91+
EXCLUDE_SYMBOLS = *::detail *::detail::* stdc::str::conv* *enable_if* stdc::is_map stdc::has_key_type* stdc::has_mapped_type* stdc::vlarray_base stdc::flag stdc::incompatible_flag stdc::winapi::kernel32 stdc::winapi::user32
9292
9393
# Doxygen does not see the configure step, so the switches are spelled out here. Without them
9494
# the export attribute reads as part of every class name, and the platform headers document

‎include/stdcorelib/stlextra/algorithms.h‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,17 @@ namespace stdc {
1313
/// \addtogroup containers
1414
/// @{
1515

16-
template <typename...>
17-
using void_t = void;
18-
1916
template <typename, typename = void>
2017
struct has_key_type : std::false_type {};
2118

2219
template <typename T>
23-
struct has_key_type<T, void_t<typename T::key_type>> : std::true_type {};
20+
struct has_key_type<T, std::void_t<typename T::key_type>> : std::true_type {};
2421

2522
template <typename, typename = void>
2623
struct has_mapped_type : std::false_type {};
2724

2825
template <typename T>
29-
struct has_mapped_type<T, void_t<typename T::mapped_type>> : std::true_type {};
26+
struct has_mapped_type<T, std::void_t<typename T::mapped_type>> : std::true_type {};
3027

3128
template <typename T>
3229
struct is_map : std::conjunction<has_key_type<T>, has_mapped_type<T>> {};

0 commit comments

Comments
 (0)