Proposal for a <stdfwd> header

A couple of weeks ago I posted in c++ moderated: 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. In the trenches, often times I come across classes that can be simply defined in terms of references and pointers to other classes. An example is defining interfaces or "protocol classes." Granted, with a small project, using an <stdfwd> header does not provide a big advantage, but I deal with 500+ files in a framework... I believe that the rationale is so simple that I even feel lazy about explaining the benefits, but oh well: // needlessly including the definition of string (or basic_string) and vector #include <string> #include <vector> class ISeek{ public: virtual void seek_knowledge(const std::string& token) = 0; virtual void seek_advice(const std::vector<std::string>& advisers) = 0; }; // using the proposed header... #include <stdfwd> class ISeek{ public: virtual void seek_knowledge(const std::string& token) = 0; virtual void seek_advice(const std::vector<std::string>& advisers) = 0; }; Please ready your darts and fire at will. I'd like to know if there is enough support that it could fly in a proposal to the std committee. Javier jestrada at developeer dot com

"Javier Estrada" <ljestrada@hotmail.com> wrote in message news:c2ib4s$meg$1@sea.gmane.org...
I think comp.std.c++ is where you should post this. I'd also like to have a facility for forward declaring names in std; it should definitely be more fine-grained than <stdfwd>, though. Why not have <xxxfwd> headers for standard headers <xxx> not currently covered by <iosfwd>? Jonathan

On Sat, 13 Mar 2004 10:57:06 -0700, Jonathan Turkanis wrote
You might be interested in this email thread where this topic was previously discussed. http://lists.boost.org/MailArchives/boost/msg14932.php Turns out you are right to go to comp.std.c++ because the current standard basically precludes this. Of course, I'll be happy to post my attempt at this if you want to use it. Jeff

"Jeff Garland" <jeff@crystalclearsoftware.com> wrote in message news:20040314032429.M15368@crystalclearsoftware.com...
On Sat, 13 Mar 2004 10:57:06 -0700, Jonathan Turkanis wrote
Yeah, that's why I suggested comp.std.c++.
Of course, I'll be happy to post my attempt at this if you want to use it.
If only it could be justified somehow as a 'broken compiler workaround' ;-) Jonathan
participants (3)
-
Javier Estrada
-
Jeff Garland
-
Jonathan Turkanis