Date: Thu, 06 Feb 2025 15:01:14 +0200
On Mon, 2025-02-03 at 17:44 +0300, Andrey Semashev via Std-Proposals
wrote:
> On 2/3/25 15:28, Avi Kivity via Std-Proposals wrote:
> > 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] <mailto: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;
>
> Modules don't exist.
>
That's unfortunately correct, but effort is better spent on making them
exist.
wrote:
> On 2/3/25 15:28, Avi Kivity via Std-Proposals wrote:
> > 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] <mailto: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;
>
> Modules don't exist.
>
That's unfortunately correct, but effort is better spent on making them
exist.
Received on 2025-02-06 13:01:45