coord/ops: add scalar bool overload for any

This commit is contained in:
Danny Robson 2018-04-11 18:22:49 +10:00
parent 2d801a1725
commit f830b149b0

View File

@ -1225,6 +1225,19 @@ namespace util {
}
///------------------------------------------------------------------------
/// returns true if the value is true.
///
/// provided so that templates may operate with the same calls for vectors
/// and scalars. eg, any (t >= 0 && t <= 1) should work for arbitrary
/// types.
constexpr
bool any (const bool val)
{
return val;
}
///////////////////////////////////////////////////////////////////////////
namespace detail {
template <
@ -1272,7 +1285,7 @@ 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.
/// and scalars. eg, all (t >= 0 && t <= 1) should work for either type.
constexpr bool
all (bool val)
{