https://svn.lrde.epita.fr/svn/oln/trunk/metalic
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Tiny fix.
* mlc/typedef.hh (result): Rename as...
(result_): ...this; disambiguation.
* mlc/cmp.hh (assert_found_),
(assert_not_found_): New.
cmp.hh | 10 ++++++++++
typedef.hh | 18 +++++++++---------
2 files changed, 19 insertions(+), 9 deletions(-)
Index: mlc/typedef.hh
--- mlc/typedef.hh (revision 866)
+++ mlc/typedef.hh (working copy)
@@ -161,29 +161,29 @@
static no selector(...); \
\
template <class T, bool found_> \
- struct result; \
+ struct result_; \
\
template <class T> \
- struct result <T, true> { \
+ struct result_ <T, true> { \
typedef typename T::TypedefName ret; \
}; \
\
template <class T> \
- struct result <T, false> { \
+ struct result_ <T, false> { \
typedef mlc::not_found ret; \
}; \
\
template <class T, bool found_> \
- struct result2; \
+ struct result_2; \
\
template <class T> \
- struct result2 <T, true> { \
+ struct result_2 <T, true> { \
typedef mlc::pair_<mlc::found, \
typename T::TypedefName> ret; \
}; \
\
template <class T> \
- struct result2 <T, false> { \
+ struct result_2 <T, false> { \
typedef mlc::pair_<mlc::not_found, \
mlc::dummy> ret; \
}; \
@@ -205,11 +205,11 @@
}; \
public: \
typedef \
- typename helper_::result<T, found_>::ret \
+ typename helper_::result_<T, found_>::ret \
ret; \
\
typedef \
- typename helper_::result2<T, found_>::ret \
+ typename helper_::result_2<T, found_>::ret \
ret2; \
}; \
\
@@ -235,7 +235,7 @@
\
} \
\
-struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n \
+struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
/*! \macro mlc_typedef(Type, TypedefName)
Index: mlc/cmp.hh
--- mlc/cmp.hh (revision 866)
+++ mlc/cmp.hh (working copy)
@@ -161,6 +161,16 @@
struct is_found_ : public mlc_is_not_a(T, mlc::not_found)::bexpr
{
};
+
+ template <typename T, typename err = no_error_message>
+ struct assert_found_ : public assert_< is_found_<T>, err >
+ {
+ };
+
+ template <typename T, typename err = no_error_message>
+ struct assert_not_found_ : public assert_< is_not_found_<T>, err >
+ {
+ };
/// \}