monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Descriptors do make a difference 8-O


From: Christof Petig
Subject: Re: [Monotone-devel] Descriptors do make a difference 8-O
Date: Thu, 28 Apr 2005 21:39:36 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050404)

Florian Weimer schrieb:
>>Is
>>  func((some_string+"something").c_str())
>>guaranteed to work with every compiler.
>
>
> Yes, deallocation of the temporary will be deferred to after the
> evalation of the full expression.
>
> And what are descriptors?

Simple: instead of using something like (pseudo C)
  S= printf("insert into table values ('%s',%d)" , "string", 42)
  sql_execute (S)
you use
  sql_execute("insert into table values (?,?)", "string", 42)

A descriptor points to a prepared (parsed) SQL statement which you can
execute with different data. So descriptors save some string copying and
parsing.

  Christof

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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