A sequence is false if all it contains is false
This commit is contained in:
parent
6e4581690d
commit
27fc3a3d43
1 changed files with 7 additions and 1 deletions
|
|
@ -94,7 +94,13 @@ value_t::operator bool() const
|
|||
case STRING:
|
||||
return ! as_string().empty();
|
||||
case SEQUENCE:
|
||||
return ! as_sequence().empty();
|
||||
if (! as_sequence().empty()) {
|
||||
foreach (const value_t& value, as_sequence()) {
|
||||
if (value)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case POINTER:
|
||||
return ! as_any_pointer().empty();
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue