C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Extend std::type_info with more information

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Sun, 14 Apr 2024 14:51:12 +0100
On Sat, Apr 13, 2024 at 1:43 AM Frederick Virchanza Gotham wrote:
>
> If you look at the cppreference webpage for the <type_traits>
> header, and discard all the deprecated one's, you're left with a list
> of 64 booleans
<snip>
> class extended_type_info {
> template<typename T>
> friend extended_type_info typeidex(void) noexcept;
> protected:
> std::bitset<60u> b;
> public:
> bool is_compound() const noexcept { return !is_fundamental(); }
> bool is_member_pointer() const noexcept { return
> is_member_function_pointer() || is_member_object_pointer(); }
>
> bool has_unique_object_representations() const noexcept { return b[0]; }
> bool has_virtual_destructor() const noexcept { return b[1]; }
> bool is_abstract() const noexcept { return b[2]; }
> bool is_aggregate() const noexcept { return b[3]; }
> bool is_arithmetic() const noexcept { return b[4]; }
> . . .
> . . .
> . . .
> };



Is anyone keen on having an extended_type_info which contains a 64-Bit
number to record all the boolean type_traits?

Received on 2024-04-14 13:51:21