Olena-patches] 510: Add some shortcuts in mlc.

2006-08-31 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr> * mlc/case.hh (mlc_case_equipment_for_namespace): Add where_ so that the whole equipment is well-localized in the client namespace. * mlc/cmp.hh (assert_equal_, assert_defined_): New shortcuts. Index: mlc/case.hh =================================================================== --- mlc/case.hh (revision 509) +++ mlc/case.hh (working copy) @@ -151,6 +151,13 @@ namespace NAMESPACE \ { \ \ + \ + template <typename bexpr> \ + struct where_ : public mlc::where_<bexpr> \ + { \ + }; \ + \ + \ template <typename context, \ typename data, \ unsigned i = mlc::internal::unknown_case_id> \ Index: mlc/cmp.hh =================================================================== --- mlc/cmp.hh (revision 509) +++ mlc/cmp.hh (working copy) @@ -31,6 +31,7 @@ # include <mlc/bexpr.hh> # include <mlc/is_a.hh> # include <mlc/logic.hh> +# include <mlc/assert.hh> @@ -119,6 +120,11 @@ public bexpr_<true> { }; + + template <typename T1, typename T2, typename err = no_error_message> + struct assert_equal_ : public assert_< eq_<T1, T2>, err > + { + }; /// \} @@ -169,6 +175,11 @@ struct is_defined_ : public mlc_is_not_a(T, mlc::undefined)::bexpr { }; + + template <typename T, typename err = no_error_message> + struct assert_defined_ : public assert_< is_defined_<T>, err > + { + }; /// \}
participants (1)
-
Thierry GERAUD