This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
| 1 |
#ifndef CHILON_NONE_HPP |
| 2 |
#define CHILON_NONE_HPP |
| 3 |
|
| 4 |
namespace chilon { |
| 5 |
|
| 6 |
namespace detail { |
| 7 |
|
| 8 |
template <bool Answer = false> |
| 9 |
struct none { |
| 10 |
template <class T> |
| 11 |
bool operator==(T const& t) const { return Answer; } |
| 12 |
|
| 13 |
template <class T> |
| 14 |
bool operator!=(T const& t) const { return Answer; } |
| 15 |
|
| 16 |
#ifdef __GXX_EXPERIMENTAL_CXX0X__ |
| 17 |
template <class... T> |
| 18 |
bool test(T const&... in) const { return Answer; } |
| 19 |
#else |
| 20 |
template <class T> |
| 21 |
bool test(T const& in) const { return Answer; } |
| 22 |
#endif |
| 23 |
}; |
| 24 |
|
| 25 |
}; // end detail namespace |
| 26 |
|
| 27 |
|
| 28 |
struct none : detail::none<> { |
| 29 |
typedef none value_type; |
| 30 |
#ifdef __GXX_EXPERIMENTAL_CXX0X__ |
| 31 |
template <class... T> |
| 32 |
none(T const&... in) {} |
| 33 |
#else |
| 34 |
template <class T> |
| 35 |
none(T const& in) {} |
| 36 |
#endif |
| 37 |
}; |
| 38 |
|
| 39 |
struct none_true : detail::none<true> { |
| 40 |
typedef none_true value_type; |
| 41 |
#ifdef __GXX_EXPERIMENTAL_CXX0X__ |
| 42 |
template <class... T> |
| 43 |
none_true(T const&... in) {} |
| 44 |
#else |
| 45 |
template <class T> |
| 46 |
none(T const& in) {} |
| 47 |
#endif |
| 48 |
}; |
| 49 |
|
| 50 |
} |
| 51 |
|
| 52 |
#endif |