List:MySQL++« Previous MessageNext Message »
From:Chris Frey Date:November 21 2005 2:08am
Subject:Re: Query class derived from std::ostream constructor issue
View as plain text  
On Thu, Nov 17, 2005 at 05:27:56PM -0500, Spinka, Kristofer wrote:
> Hi, I've noticed a serious bug that was introduced in 
> MySQL++ v2.0.0 when the Query class was changed to derive 
> from std::ostream.
> 
> Per the C++ standard, regardless of the order of 
> statements in a constructor's initialization list, base 
> classes are initialized before the members of the current 
> class are.

Thanks for this bug report and patch!  I believe this will affect the
ABI, so I'm waiting for Warren's comments.

I think a better way to handle this would be to use the protected
init() member.  Regular streams like fstream and stringstream need to
behave the same way as our Query, since they need to controll their
own buf objects.

For example, they do (from g++ headers):

      basic_ifstream()
      : __istream_type(NULL), _M_filebuf()
      { this->init(&_M_filebuf); }

This would prevent a change in the ABI.

- Chris

Thread
Query class derived from std::ostream constructor issueKristofer Spinka17 Nov
  • Re: Query class derived from std::ostream constructor issueChris Frey21 Nov
    • Re: Query class derived from std::ostream constructor issueChris Frey21 Nov
      • Re: Query class derived from std::ostream constructor issueWarren Young23 Nov
        • Re: Query class derived from std::ostream constructor issueChris Frey23 Nov
Re: Query class derived from std::ostream constructor issueKristofer Spinka22 Nov