[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: value extractors for octave_value class
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: value extractors for octave_value class |
Date: |
Wed, 11 Nov 2015 23:21:00 -0500 |
On Wed, 2015-11-11 at 11:59 -0500, John W. Eaton wrote:
> When overloading these functions with (for example)
>
> Array<double> vector_value (const char *fmt, ...) const;
>
> some compilers complained that the overloaded function was ambiguous.
> I'm not sure what is best here.
How about just overloading with std::string arguments and requiring
the function caller to use sprintf in case they need formatting?
So, for example,
auto x = foo.int_value(sprintf("error: want %s but got %s", bar, baz))
- Jordi G. H.