https://svn.lrde.epita.fr/svn/oln/trunk/static
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Remove the mlc::eqv and mlc::neqv workarounds.
* stc/vtypes.hh (mlc::eqv, mlc::neqv): Remove these workarounds.
(mlc_eqv, mlc_neqv): Remove macros.
(rec_get_vtype, rec_get_ext_vtype): No longer use these
workarounds, and revert to mlc_eq and mlc_neq usage (since they
have been fixed in Metalic).
* tests/vtypes.cc (main): Adjust.
stc/vtypes.hh | 57 +++-----------------------------------------------------
tests/vtypes.cc | 10 +--------
2 files changed, 6 insertions(+), 61 deletions(-)
Index: tests/vtypes.cc
--- tests/vtypes.cc (revision 478)
+++ tests/vtypes.cc (working copy)
@@ -218,16 +218,10 @@
{
// Check types associated to A.
mlc::assert_<mlc_eq(my::A::foo_type, int)>::check();
- /* FIXME: Note that we use mlc_eqv, not mlc_eq, since the latter
- doesn't accept Metalic values. Try to get rid of this
- limitation. */
- mlc::assert_<mlc_eqv(my::A::bar_type, mlc::int_<42>)>::check();
+ mlc::assert_<mlc_eq(my::A::bar_type, mlc::int_<42>)>::check();
// Check types associated to B.
- /* FIXME: Note that we use mlc_neqv, not mlc_neq, since the latter
- doesn't accept Metalic values. Try to get rid of this
- limitation. */
- mlc::assert_<mlc_neqv(my::B::bar_type, my::A::bar_type)>::check();
+ mlc::assert_<mlc_neq(my::B::bar_type, my::A::bar_type)>::check();
mlc::assert_<mlc_eq(my::B::baz_type, char)>::check();
mlc::assert_<mlc_eq(my::B::quux_type, long)>::check();
mlc::assert_<mlc_eq(my::B::yin_type, unsigned long)>::check();
Index: stc/vtypes.hh
--- stc/vtypes.hh (revision 478)
+++ stc/vtypes.hh (working copy)
@@ -42,55 +42,6 @@
# include <mlc/is_a.hh>
-/*----------------------.
-| Metalic workarounds. |
-`----------------------*/
-
-/// Shortcuts.
-/// \{
-# define mlc_eqv( T1, T2) mlc::eqv_ <T1, T2>
-# define mlc_neqv(T1, T2) mlc::neqv_<T1, T2>
-/// \}
-
-namespace mlc
-{
- /* FIXME: This really is a work around Metalic's limitations
- regarding the operands of its logic operators than cannot be
- subtypes of mlc::abstract::value. This limitations breaks Static
- when a virtual type *is* a Metalic value! Hence the introduction
- of this more laxist version of mlc_neq. */
-
- /// Equality test between a couple of types, also accepting Metalic
- /// values (i.e., subtypes of mlc::abstract::value).
- /// \{
- template <typename T1, typename T2>
- struct eqv_ : public bexpr_<false>
- {
- };
-
- template <typename T>
- struct eqv_ <T, T> : public bexpr_<true>
- {
- };
- /// \}
-
- /// Inequality test between a couple of types, also accepting Metalic
- /// values (i.e., subtypes of mlc::abstract::value).
- /// \{
- template <typename T1, typename T2>
- struct neqv_ : public bexpr_<true>
- {
- };
-
- template <typename T>
- struct neqv_ <T, T> : public bexpr_<false>
- {
- };
- /// \}
-
-} // end of namespace mlc
-
-
/*------------.
| Equipment. |
`------------*/
@@ -208,7 +159,7 @@
\
typedef typename \
mlc::if_< \
- mlc::neqv_< type, mlc::not_found >, \
+ mlc::neq_< type, mlc::not_found >, \
/* then */ \
/* return it */ \
/* (the typedef has been found in the vtypes */ \
@@ -218,7 +169,7 @@
/* check if the vtype of the `super' of FROM_TYPE */ \
/* has the typedef */ \
typename \
- mlc::if_< mlc::neqv_< typename rec_get_vtype<category, \
+ mlc::if_< mlc::neq_< typename rec_get_vtype< category, \
super, \
typedef_type>::ret, \
mlc::not_found >, \
@@ -276,7 +227,7 @@
\
typedef typename \
mlc::if_< \
- mlc::neqv_< type, mlc::not_found >, \
+ mlc::neq_< type, mlc::not_found >, \
/* then */ \
/* return it */ \
/* (the typedef has been found in the vtypes */ \
@@ -286,7 +237,7 @@
/* check if the vtype of the `super' of FROM_TYPE */ \
/* has the typedef */ \
typename \
- mlc::if_< mlc::neqv_< typename rec_get_ext_vtype<category, \
+ mlc::if_< mlc::neq_< typename rec_get_ext_vtype< category, \
super, \
typedef_type>::ret, \
mlc::not_found >, \