Fixed is_nil(size_t) when checking out-of-range element
This commit is contained in:
parent
ae15032e0f
commit
24a91d7420
1 changed files with 1 additions and 1 deletions
|
@ -776,7 +776,7 @@ public:
|
|||
static int nil_value() { return std::numeric_limits<int>::max(); }
|
||||
// A scalar is nil, or all values of a vector are nil.
|
||||
bool is_nil() const override { for (auto v : this->values) if (v != nil_value()) return false; return true; }
|
||||
bool is_nil(size_t idx) const override { return this->values[idx] == nil_value(); }
|
||||
bool is_nil(size_t idx) const override { return values[idx < this->values.size() ? idx : 0] == nil_value(); }
|
||||
|
||||
std::string serialize() const override
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue