[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++ API bool is* functions
From: |
siko1056 |
Subject: |
Re: C++ API bool is* functions |
Date: |
Wed, 3 Jan 2018 13:23:35 -0700 (MST) |
Andreas Weber-6 wrote
> [...] I found out that "is_true" throws an error for Cell inputs. Is this
> wanted? And if yes, why is "is_true" the only one?
>
> -- Andy
Dear Andy,
I am afraid, that this behavior is wanted, see [1]:
bool
octave_cell::is_true (void) const
{
error ("invalid conversion from cell array to logical value");
}
The reason for this is not obvious to me. To my knowledge implicit
conversion might happen in C++ with constructors only [2]?
Best,
Kai
[1]
https://www.octave.space/latest/doxygen/d7/ded/ov-cell_8cc_source.html#l00537
[2] http://en.cppreference.com/w/cpp/language/explicit
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html