Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will the standard library of C++11 have forward declaration headers?

In C++03 there are no <vectorfwd>-like files, while there is the <iosfwd> header. Will this change in the future?

It could be valuable to reduce dependencies and for better modularity.

UPDATE:

I have received an answer from the language creator: "practically it's not possible to require this from all STL vendors".

like image 291
Iakov Minochkin Avatar asked Nov 02 '11 11:11

Iakov Minochkin


People also ask

What are the headers of the C++ standard library?

The interface of C++ standard library is defined by the following collection of headers. For some of the C standard library headers of the form xxx.h, the C++ standard library both includes an identically-named header and another header of the form cxxx (all meaningful cxxx headers are listed above).

What is forward declaration in C++?

Forward Declaration refers to the beforehand declaration of the syntax or signature of an identifier, variable, function, class, etc. prior to its usage (done later in the program). Example: In C++, Forward declarations are usually used for Classes.

What is the difference between C++ standard and C standard headers?

The C++ Standard requires that the C Standard headers declare all external names in namespace std, then hoist them into the global namespace with individual using declarations for each of the names. But in some translation environments the C Standard headers include no namespace declarations, declaring all names directly in the global namespace.

What is a freestanding C++ library implementation?

The C++ standard library provides the C++ library headers and additional C++ headers for C library facilities (see ' headers ' page for descriptions): A freestanding implementation has an implementation-defined set of headers, see here for the minimal requirement on the set of headers.


1 Answers

No, there are no new forward files, just the old <iosfwd>.

The complete I/O-system is large compared to a vector, so the advantage would perhaps not be that significant.

like image 63
Bo Persson Avatar answered Sep 27 '22 17:09

Bo Persson