C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Specify the mangled name

From: avi_at <avi_at_[hidden]>
Date: Mon, 03 Feb 2025 14:28:33 +0200
On Mon, 2025-02-03 at 13:05 +0100, Marcin Jaczewski via Std-Proposals
wrote:
> 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?


import std;





Received on 2025-02-03 12:28:37