Hello Nikki,

I'd suggest either not doing it (prevent the copy constructor from
compiling by declaring it private) or doing it by passing ownership of
the connection around as if it was a socket or file handle.

That's how I do sockets. If my socket class gets copy constructed to a
new class, that class becomes the "owner" of the socket and no further
socket operations are permitted in the original class.

The problem with opening a new connection in the new class constructor
is that it's not really in the same state as the original connection.

C

Tuesday, August 2, 2011, 10:20:21 PM, you wrote:

NT> Hi sqlite-users!
NT>     It's just that I'm writing a copy constructor of my own mini sqlite
NT> wrapper, and I ended up having to do a deep copy of a sqlite3* points to a
NT> SQLite connection. And I'm just wondering is it okay that I just do it with
NT> memcpy(), by digging into the code for the definition of struct sqlite3  and
NT> count the total bytes of this struct?
NT>     Any ideas or suggestions are appreciated!
NT> _______________________________________________
NT> sqlite-users mailing list
NT> [email protected]
NT> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



-- 
Best regards,
 Teg                            mailto:[email protected]

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to