cwCommonImpl.h : Added is_even().
This commit is contained in:
parent
e4db08a893
commit
d7eab641c0
@ -16,6 +16,9 @@
|
|||||||
#include <limits> // std::numeric_limits<
|
#include <limits> // std::numeric_limits<
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <cmath>
|
||||||
|
#include <complex>
|
||||||
|
|
||||||
|
|
||||||
#if defined(OS_LINUX) || defined(OS_OSX)
|
#if defined(OS_LINUX) || defined(OS_OSX)
|
||||||
#define cwPOSIX_FILE_SYS
|
#define cwPOSIX_FILE_SYS
|
||||||
@ -176,6 +179,12 @@ namespace cw
|
|||||||
void sleepUs( unsigned us ); // sleep seconds
|
void sleepUs( unsigned us ); // sleep seconds
|
||||||
void sleepNs( unsigned ns ); // sleep nanoseconds
|
void sleepNs( unsigned ns ); // sleep nanoseconds
|
||||||
|
|
||||||
|
template< typename T >
|
||||||
|
bool is_even( const T& t )
|
||||||
|
{
|
||||||
|
assert( is_integral(t) );
|
||||||
|
return (t % 2) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user