It would be nice if there were publicly visible headers analogous to <iosfwd>
for <string> and all the STL headers.  To be more concrete: for every STL
header <container>  there should be a <gnu/containerfwd> that contains *only*
forward declarations of the types with complete declarations in <container>. 
The existing <bits/stringfwd.h> is an example of exactly what I have in mind,
and should be promoted to <gnu/stringfwd>.

The value of these headers would be primarily in writing application headers;
it is common to need to include <string> or <map> or whatever solely to be able
to refer to the types it defines in function prototypes.  By providing
forward-declaration headers, the application headers would not need to drag in
the full text of the STL headers.  Application source files could then include
the complete-declaration headers only for the types they actually used.


-- 
           Summary: Extension request: publicly visible forward-declaration
                    headers for <string> and all STL containers
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zackw at panix dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31464

Reply via email to