List:MySQL++« Previous MessageNext Message »
From:Jonathan Wakely Date:January 11 2010 12:51pm
Subject:Re: mysqlpp::ScopedConnection
View as plain text  
2010/1/11 Joel Fielder:
> Jonathan Wakely wrote:
>>>
>>> If you want to donate the class under the LGPL, it sounds like something
>>> we'd like to have in MySQL++.
>>>
>>
>> I'd be happy to review any patch.
>>
>
> Ok, see patch inline below.  Hope you find it useful.
>
> It's non-copyable so you can't use it in a container or in a copyable
> object.

Excellent.

A few comments:

There's no need to make the default constructor private. Declaring any
other user-defined constructor disables the implicit generation of a
default constructor.  Making it private means attempting to use it
will give a "constructor is private" error rather than a "no such
constructor" error.  Personally I think the latter is preferable so I
would remove the declaration of the private default constructor.

The ScopedConnection(ConnectionPool&) constructor should probably be
marked 'explicit' because there is no need to support implicit
conversion from a ConnectionPool to a ScopedConnection.

In the constructor definition in the .cpp file it's unnecessary (but
harmless) to qualify mysqlpp::ConnectionPool

Regards,

Jonathan
Thread
Query::execute crashes without a connected driverJoel Fielder7 Jan
  • Re: Query::execute crashes without a connected driverWarren Young7 Jan
    • Re: Query::execute crashes without a connected driverJoel Fielder8 Jan
    • mysqlpp::ScopedConnectionJoel Fielder8 Jan
      • Re: mysqlpp::ScopedConnectionWarren Young9 Jan
        • Re: mysqlpp::ScopedConnectionJonathan Wakely9 Jan
          • Re: mysqlpp::ScopedConnectionJoel Fielder11 Jan
            • Re: mysqlpp::ScopedConnectionJonathan Wakely11 Jan
              • Re: mysqlpp::ScopedConnectionWarren Young11 Jan
                • Re: mysqlpp::ScopedConnectionJonathan Wakely11 Jan
    • Re: Query::execute crashes without a connected driverJoel Fielder13 Jan
      • Re: Query::execute crashes without a connected driverWarren Young13 Jan
Re: mysqlpp::ScopedConnectionJoel Fielder11 Jan
  • Re: mysqlpp::ScopedConnectionWarren Young11 Jan
    • Re: mysqlpp::ScopedConnectionJoel Fielder11 Jan
      • Re: mysqlpp::ScopedConnectionWarren Young11 Jan
        • Re: mysqlpp::ScopedConnectionJoel Fielder12 Jan