~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/util/test.h

more updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLED_UTIL_TEST_H
22
22
#define DRIZZLED_UTIL_TEST_H
23
23
 
24
 
#if defined(__cplusplus)
25
 
 
26
 
namespace drizzled
27
 
{
 
24
namespace drizzled {
28
25
 
29
26
template <class T>
30
 
inline bool test(const T a)
 
27
bool test(const T a)
31
28
{
32
 
  return a ? true : false;
 
29
  return a;
33
30
}
34
31
 
35
32
template <class T, class U>
36
 
inline bool test_all_bits(const T a, const U b)
 
33
bool test_all_bits(const T a, const U b)
37
34
{
38
 
  return ((a & b) == b);
 
35
  return (a & b) == b;
39
36
}
40
37
 
41
38
} /* namespace drizzled */
42
39
 
43
 
#else
44
 
# define test(a)    ((a) ? 1 : 0)
45
 
# define test_all_bits(a,b) (((a) & (b)) == (b))
46
 
#endif
47
 
 
48
40
#endif /* DRIZZLED_UTIL_TEST_H */