On 11 February 2011 18:38, Jonathan Wakely wrote:
> On 11 February 2011 18:30, Remi Collet wrote:
>> During fedora 15 mass rebuild, mysql++ fails to build because of some
>> changes in new GCC 4.6.
>> In file included from ./lib/sql_buffer.h:31:0,
>> ./lib/refcounted.h:258:2: error: 'size_t' does not name a type
>> From GCC documentation:
>> STL headers not including <cstddef> any longer
>> 2 solutions :
>> - include <cstddef>
>> - use std::size_t
> std::size_t is defined by <cstddef>, so the correct fix if you want to
> use size_t is to explicitly include either <stddef.h> (for ::size_t)
> or <cstddef> (for std::size_t)
> Otherwise some other change to the Standard Library could cause the
> same problem again. If you use a type, include the header that
> declares it.
And that's not just idle speculation, we have an ongoing effort *not*
to include unnecessary headers in libstdc++, so that including a
header only declares the types required by the standard.