On Oct 14, 2009, at 9:24 PM, Adam Nielsen wrote:
> I'm trying to open a new connection to a MySQL database by
> duplicating an
> existing connection (as the docs[1] seem to indicate this is an
> acceptable
> method) however it causes my application to segfault.
That's not the purpose of the copy ctor. It exists solely so you can
say things like this:
void foo() {
Connection conn(...parms...);
...do stuff...
return conn;
}
Without a dedicated copy ctor to manage certain under-the-hood
details, this would fail.
You might look at ConnectionPool, as that centralizes creation of
multiple connections, using a common create() method for all.