coord/ops: add `all' overload for scalar bool
This commit is contained in:
parent
deb787847c
commit
bafe71b3ab
@ -1269,6 +1269,18 @@ namespace util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///------------------------------------------------------------------------
|
||||||
|
/// returns true if the value is true.
|
||||||
|
///
|
||||||
|
/// provided so that templates may operate with the same calls for vectors
|
||||||
|
/// and scalars. eg, all (t >= 0 && t <= 1) shold work for either type.
|
||||||
|
constexpr bool
|
||||||
|
all (bool val)
|
||||||
|
{
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///------------------------------------------------------------------------
|
///------------------------------------------------------------------------
|
||||||
/// returns an instance of K elementwise using a when s is true, and b
|
/// returns an instance of K elementwise using a when s is true, and b
|
||||||
/// otherwise. ie, k[i] = s[i] ? a[i] : b[i];
|
/// otherwise. ie, k[i] = s[i] ? a[i] : b[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user