List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:April 20 2007 2:45pm
Subject:Re: Differences between query constructors
View as plain text  
Joel Fielder wrote:
> 
> Just wondered why there is a difference between the query constructors:

No good reason.  Probably just because few people actually use the Query 
copy ctor, so it isn't causing real problems in the field.  It's fixed now.

> Also, in the first constructor, if success_ is meant to indicate whether
> the last query was successful, shouldn't it be left initialised at false
> rather than set to true after calling init, assuming that no query took
> place?

No.  Query::success_ indicates more than the result of the last query. 
It's a flag to indicate whether _anything_ has gone wrong with the 
object.  Notice that you basically get this flag's value when casting 
Query to bool.  The semantics are:

	Query q;
	if (q) {
		// life is good...
	}
	else {
		// panic!!
	}
Thread
Differences between query constructorsJoel Fielder20 Apr
  • Re: Differences between query constructorsWarren Young20 Apr
    • Re: Differences between query constructorsJoel Fielder20 Apr
      • Re: Differences between query constructorsWarren Young20 Apr
        • Re: Differences between query constructorsJonathan Wakely20 Apr