cwCommonImpl.h : Added is_even().

This commit is contained in:
kevin 2020-10-04 10:49:52 -04:00
parent e4db08a893
commit d7eab641c0

View File

@ -16,6 +16,9 @@
#include <limits> // std::numeric_limits<
#include <atomic>
#include <cstdint>
#include <cmath>
#include <complex>
#if defined(OS_LINUX) || defined(OS_OSX)
#define cwPOSIX_FILE_SYS
@ -176,6 +179,12 @@ namespace cw
void sleepUs( unsigned us ); // sleep seconds
void sleepNs( unsigned ns ); // sleep nanoseconds
template< typename T >
bool is_even( const T& t )
{
assert( is_integral(t) );
return (t % 2) == 0;
}
}