pon., 3 lut 2025 o 12:50 Frederick Virchanza Gotham via Std-Proposals
On Mon, Feb 3, 2025 at 11:14 AM Andrey Semashev wrote:
It is not. A forward declaration would suffice.
But I'll be need forward declarations for other stuff like "std::less"
and "std::allocator":
namespace std {
template<class T> class less;
template<class T> class allocator;
template< class Key, class Compare = less<Key>, class
Allocator = allocator<Key> > class set;
}
typedef std::set<unsigned> IndexSet;
Then problem is not that you need "aliases" but that std types are a
pain to forward declare.
Because the code you show here is invalid as for most standard libs
this is not a declaration of `set`.
Question is could standard fix it and allow users to have a way to
forward declare standard classes
without including whole implementation?
We already have `<iosfwd>` could standard mandate a similar header for
the rest of stdlib?