Why did you make streambufs noncopyable?

Daryle Walker dwalker07@snet.net
Thu Jun 5 03:46:00 GMT 2003


On Wednesday, June 4, 2003, at 04:51  AM, Phil Edwards wrote:

[For context, I'm asking about the GCC change to block copying for 
std::basic_streambuf<>.  This gave me errors when I tried compiling on 
GCC since my streambuf-derived class has a copy constructor.]
>> If you're not going to correct it, how should I block the code off 
>> (with the preprocessor)?
>
> ????

In the group I'm working with, we block off code that has quirks with 
certain compilers with preprocessor macros.  In this case, I want to 
block off code that contains stream-buffer copying away from GCC.  I 
heard that you define macros "__GNUC__" and "__GNUC_MINOR__" so 
programs will know when they're being compiled under GCC.  In this case 
I would put something like:

#if defined(__GNUC__) && (( __GNUC__ > 3 ) || ( (__GNUC__ == 3) && 
(__GNUC_MINOR__ >= XXX) ))
// my code that you don't like
#endif

Here, I would need to know when you introduced this change.  
Specifically, I need the value of the "XXX" I had in this example.  Of 
course, if this preprocessor check is totally wrong, please correct.

Daryle



More information about the Gcc mailing list