C++ Logo

std-proposals

Advanced search

[std-proposals] bool type_info::operator<(type_info const &)

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Sat, 1 Apr 2023 17:15:06 +0100
The type 'type_info' has a member function called 'before'.

If it were also to have the following:

bool operator<(type_info const &arg)
{
    return this->before(arg);
}

then this would mean that we could have an ordered container of
'type_info', e.g.

    std::set<type_info> myset;

Presently this is only possible by specialising 'std::set' with a
custom comparator.

Received on 2023-04-01 16:15:17