547: Make virtual type retrieval more flexible and fix automatic::impl.

https://svn.lrde.epita.fr/svn/oln/trunk/static Index: ChangeLog from Roland Levillain <roland@lrde.epita.fr> Make virtual type retrieval more flexible and fix automatic::impl. * stc/vtypes.hh (automatic::impl): Turn the first parameter into a `template <class> class'. (select_typedef): Typo in comment. Don't abort on default case; not finding a virtual type is no lomger a static error, but instead just gives mlc::not_found. (type_of_): Likewise, don't abort on mlc::not_found, just return it. vtypes.hh | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) Index: stc/vtypes.hh --- stc/vtypes.hh (revision 546) +++ stc/vtypes.hh (working copy) @@ -234,7 +234,7 @@ /** Default (empty) automatic implementation. */ \ namespace automatic { \ \ - template <typename abstraction, typename tag, typename E> \ + template <template <class> class abstraction, typename E, typename tag> \ class impl \ { \ }; \ @@ -702,7 +702,7 @@ stc::ERROR::VIRTUAL_TYPE_MULTIPLY_DEFINED_AS_INTERNAL_AND_SINGLE \ > \ { \ - /* Error, not valid typedef found. */ \ + /* Error, no valid typedef found. */ \ typedef mlc::not_found ret; \ }; \ \ @@ -718,7 +718,7 @@ stc::ERROR::VIRTUAL_TYPE_MULTIPLY_DEFINED_AS_INTERNAL_AND_EXTERNAL \ > \ { \ - /* Error, not valid typedef found. */ \ + /* Error, no valid typedef found. */ \ typedef mlc::not_found ret; \ }; \ \ @@ -734,7 +734,7 @@ stc::ERROR::VIRTUAL_TYPE_MULTIPLY_DEFINED_AS_SINGLE_AND_EXTERNAL \ > \ { \ - /* Error, not valid typedef found. */ \ + /* Error, no valid typedef found. */ \ typedef mlc::not_found ret; \ }; \ \ @@ -752,22 +752,18 @@ VIRTUAL_TYPE_MULTIPLY_DEFINED_AS_INTERNAL_AND_SINGLE_AND_EXTERNAL \ > \ { \ - /* Error, not valid typedef found. */ \ + /* Error, no valid typedef found. */ \ typedef mlc::not_found ret; \ }; \ \ - /** Other cases: error (the typedef is not defined or defined more */ \ - /** than once, hence \a mlc::not_found is returned). */ \ + /** All other cases: \a mlc::not_found is returned, but no static. */ \ + /** error is raised. */ \ template \ < typename internal_vtype_candidate, bool found_as_internal_vtype, \ typename single_vtype_candidate, bool found_as_single_vtype, \ typename extended_vtype_candidate, bool found_as_extended_vtype > \ - struct select_typedef : \ - mlc::abort_ < \ - internal_vtype_candidate /* dummy */ , \ - stc::ERROR::NO_VALID_VIRTUAL_TYPE_FOUND > \ + struct select_typedef \ { \ - /* Error, not valid typedef found. */ \ typedef mlc::not_found ret; \ }; \ /** \} */ \ @@ -812,13 +808,6 @@ internal_vtype_candidate, found_as_internal_vtype, \ single_vtype_candidate, found_as_single_vtype, \ extended_vtype_candidate, found_as_extended_vtype \ - >::ret candidate; \ - \ - typedef typename \ - mlc::assert_and_return_< \ - mlc_neq(candidate, mlc::not_found), \ - candidate, \ - stc::ERROR::NO_VALID_RETURN_TYPE_FOR_type_of_ \ >::ret ret; \ }; \ \
participants (1)
-
Roland Levillain