Personally, I don't use var-args in C++ code.  You lose type-safety,
can't use user-defined types, and can't detect when the wrong number of
arguments is passed, not even at run-time.

Instead, I'd create a class you can 'feed' variables too in much the
same way that boost::format works.

See http://www.boost.org/doc/libs/1_38_0/libs/format/doc/format.html for
more details.

Logan Ratner | +1 713 839 9656

-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Vinnie
Sent: Monday, April 27, 2009 7:07 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] How do you guys use sqlite from C++?


> From: Neville Franks <sql...@surfulater.com>
> Subject: Re: [sqlite] How do you guys use sqlite from C++?
> I use a modified version of the C++ wrapper
> http://www.codeproject.com/KB/database/CppSQLite.aspx

Apparently I did come up with an original idea. Because none of the
wrappers from the archives are using variable argument lists. All these
wrappers are basically doing the same thing, a very thin layer on top of
SQlite.

My goal for a wrapper was to allow, using only a single function call,
all of the parameter binds and column values to get assigned. Having a
separate function call to retrieve each column or bind each parameter
isn't much better than straight SQLite (not that I'm complaining about
SQLite, it rocks!).

Hasn't anyone else used variable argument lists for binding parameters
and what not?



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to