octave-maintainers
[Top][All Lists]
Advanced

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

Re: Using exceptions in the core


From: Olaf Till
Subject: Re: Using exceptions in the core
Date: Wed, 7 Oct 2015 08:06:33 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Oct 06, 2015 at 11:15:00PM -0400, Mike Miller wrote:
> I still think it's a little weird to say "convert to a string for me,
> here's an error message just in case", is there really no better way?

What occured to me now, though maybe a mad idea and much more work, is
overloading as ..._value (..., bool& err) (somehow avoiding to have
the same signature as the existing functions), and for this variant
not to throw, but to set 'err' to true. This wholly avoids the
try/catch, leaves the user the resposibility to check 'err', but only
in the cases where he explicitely requested it by using this
overloaded variant.

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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