On Fri, Feb 18, 2011 at 2:50 PM, Peter Geoghegan
<peter.geoghegan86@gmail.com> wrote:
> Uh, it just occurred to me that without exceptions, there is no
> compelling way to report a failure from Read() variants. Qt does
> things like returning default constructed variables, that have values
> of 0 in the event of a failure. What do you think of that? Failures
> presumably more or less never occur with Read() overloads as things
> stand.
We generally do the same (the Read() functions tend to take a third
parameter containing the default value to return). But, returning an
error isn't a problem - we pass the value we read back in a reference
passed as a parameter, and can return true or false to indicate error
or success.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company