Date: Mon, 3 Feb 2025 13:05:38 +0100
pon., 3 lut 2025 o 12:50 Frederick Virchanza Gotham via Std-Proposals
<std-proposals_at_[hidden]> napisaĆ(a):
>
> 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?
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
<std-proposals_at_[hidden]> napisaĆ(a):
>
> 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?
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-02-03 12:05:51