monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/


From: Christof Petig
Subject: Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch
Date: Fri, 20 Jan 2006 16:12:35 +0100
User-agent: Mail/News 1.5 (X11/20060119)

Vinzenz 'evilissimo' Feenstra wrote:
> We talked about it this night and decided not to give up the va_args.
> Instead we're using a struct now which helps us to identify the value.
> So we can now use SQLITE_STATIC as argument for sqlite3_bind_text and
> sqlite3_bind_blob and can figure out in the methode database::fetch what
> kind of parameter was given.
> 
> The usage for now is:
> std::string query_ = "SELECT foo FROM bar where id = ?";
> execute(query(query_), text(id) );
> 
> or
> execute( "SELECT foo FROM bar where id = ?", text(id) );
> 
> There are to functions text() and blob()

I strongly feel that varargs is a bad choice for C++ programs, using
your proposed % syntax is much cleaner (as with L() and boost::format).

   Christof

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]