Re: Why is there only IOSfwd?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
Am 18.02.12 22:37, schrieb Martin B.:
Wouldn't it make sense to provide <...fwd> headers for many of the
std headers? (e.g. <map_fwd> or somesuch?)
I hit this issue, too. In my case it causes long compile times. Using
lots of STL in interfaces triggers lots of template instantiation.
This is true also for Boost which consists of even more code that
slows compilation. I haven't found a good solution yet. On the other
hand I may not have pushed precompiled headers enough. Well, I saw
code like this which shall make STL containers forward declarable:
class MyStuffArray;
....
class MyStuffArray
: public std::vector<MyStuff>
{};
I don't like this as a vector does not make a good base class I think.
Apart from that most of the constructors are gone now. I'd like to see
alternatives to this approach. But I see that there cannot be forwards
for typedefs, i.e.:
struct Foo;
....
typedef std::string Foo; // fails
The only thing I currently see is: use the new extern template syntax
to inhibit instantiation. Still the compiler sees all the template
code anyway. Are there other approaches that may reduce compilation time?
Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: keyserver x-hkp://pool.sks-keyservers.net
iEYEARECAAYFAk9EAGwACgkQhAOUmAZhnmqiMgCglnpTxPCtAOnPrLOZGOfNMZug
UloAnjxNa7fELERn85uosdz5Q7MxZhpJ
=hQ1X
-----END PGP SIGNATURE-----
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]