C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Why no <stdfwd> header?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
Javier Estrada
Guest





PostPosted: Sat Feb 28, 2004 3:57 am    Post subject: Why no <stdfwd> header? Reply with quote



It seems natural that if there is a <iosfwd> to forward declare the
I/O related classes, there should be a header for the classes
contained in the std namespace.

Any takers?

Regards,

Javier Estrada

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Antoun Kanawati
Guest





PostPosted: Sun Feb 29, 2004 3:04 am    Post subject: Re: Why no <stdfwd> header? Reply with quote



Javier Estrada wrote:

Quote:
It seems natural that if there is a <iosfwd> to forward declare the
I/O related classes, there should be a header for the classes
contained in the std namespace.

Any takers?

<iosfwd> forward-declares iostream related items. A <stdfwd> would
have to forward-declare EVERYTHING. That's not practical, nor
reasonable; assuming it could be done.

And, to me, this concept does not seem natural.

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Nicola Musatti
Guest





PostPosted: Mon Mar 01, 2004 7:28 pm    Post subject: Re: Why no <stdfwd> header? Reply with quote



Antoun Kanawati <antounk (AT) comcast (DOT) net> wrote

[...]
Quote:
iosfwd> forward-declares iostream related items. A <stdfwd> would
have to forward-declare EVERYTHING. That's not practical, nor
reasonable; assuming it could be done.

And, to me, this concept does not seem natural.

Yet there are many situations in which inclusion of the standard
headers brings in definitions where declarations would be sufficient.

Did you ever check out how much code is brought in in this way? On
Windows this ranges in the tens of thousands of lines.

A <stdfwd> header would help reduce dependencies and compile time.

Cheers,
Nicola Musatti

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Richard Smith
Guest





PostPosted: Mon Mar 01, 2004 7:30 pm    Post subject: Re: Why no <stdfwd> header? Reply with quote

Antoun Kanawati wrote:
Quote:
iosfwd> forward-declares iostream related items. A <stdfwd> would
have to forward-declare EVERYTHING. That's not practical, nor
reasonable; assuming it could be done.

But a header that forward declared just the containers might be useful
(and associated things like std::allocator, std::less and std::pair).
Admitedly <stdfwd> wouldn't be an appropriate name for it, but the
idea might be worth exploring. After all, it wouldn't be difficult to
implement and it wouldn't add significant complexity to language.

Also, it's something a user can't do themselves. Even aside from the
fact that it's illegal to forward declare Standard Library template's
yourself, the problem of redeclaring default template arguments stops
you from doing it yourself.

--
Richard Smith

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Hendrik Schober
Guest





PostPosted: Sat Mar 06, 2004 12:02 am    Post subject: Re: Why no <stdfwd> header? Reply with quote

Antoun Kanawati <antounk (AT) comcast (DOT) net> wrote:
Quote:
[...] A <stdfwd> would
have to forward-declare EVERYTHING. That's not practical, nor
reasonable [...]


Yes. But I really wish there would be a
<stringfwd> header.
Is someone coming up with a proposal all
it would need or is there any other reason
something like this does not exist already?
It seem sto me that this should be a rather
simple addition.

Schobi

--
[email]SpamTrap (AT) gmx (DOT) de[/email] is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers



[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.