Go to the first, previous, next, last section, table of contents.

g++ seems to want a const constructor. What's that?

gcc-2.7.1 introduced a bug that causes the compiler to ask for a const constructor (there's no such thing in C++) in certain situations where a const object appears in a template class. Most cases have been fixed in gcc-2.7.2, but unfortunately not all. Still, if you're running gcc-2.7.1 and have this problem, upgrade to 2.7.2; it is a vast improvement.

The default constructor for the template pair in ObjectSpace's implementation of STL triggers the bug in one place, for gcc 2.7.2. If you're using ObjectSpace<STL> and having this problem, simply change the default constructor from

os_pair () : first (T1 ()), second (T2 ()) {}

to just

os_pair () {}

Once this is done, ObjectSpace<STL> works fairly well.


Go to the first, previous, next, last section, table of contents.