https://svn.lrde.epita.fr/svn/oln/trunk/static Index: ChangeLog from Roland Levillain <roland@lrde.epita.fr> Rename some Static entities. * stc/properties.hh (typeof_): Rename class as... (type_of_): ...this. (stc::is_a): Rename class as... (stc::abstraction_as_type): ...this. (stc_typeof, stc_typeof_, stc_typeof_in_namespace) (stc_typeof_in_namespace_): Rename macros as... (stc_local_type_of, stc_local_type_of_, stc_type_of) (stc_type_of_): ...these. * tests/properties.cc: Adjust test. * tests/entry.cc: Typos in comments. stc/properties.hh | 41 ++++++++++++++++++++++------------------- tests/entry.cc | 8 ++++---- tests/properties.cc | 2 +- 3 files changed, 27 insertions(+), 24 deletions(-) Index: tests/properties.cc --- tests/properties.cc (revision 471) +++ tests/properties.cc (working copy) @@ -38,7 +38,7 @@ typename my_type_of_(FromType, Typedef) #define my_type_of_(FromType, Typedef) \ - stc_typeof_(my::category::my_cat, FromType, Typedef) + stc_local_type_of_(my::category::my_cat, FromType, Typedef) namespace my { Index: tests/entry.cc --- tests/entry.cc (revision 471) +++ tests/entry.cc (working copy) @@ -158,7 +158,7 @@ // Test. public mlc::where_< mlc_is_a(prop1_type, int) > { - // Super class if test succeed. + // Super class if test succeeds. typedef property1a ret; }; @@ -167,7 +167,7 @@ // Test. public mlc::where_< mlc_is_a(prop1_type, long) > { - // Super class if test succeed. + // Super class if test succeeds. typedef property1b ret; }; @@ -208,7 +208,7 @@ // Test. public mlc::where_< mlc_is_a(prop2_type, float) > { - // Super class if test succeed. + // Super class if test succeeds. typedef property2a ret; }; @@ -217,7 +217,7 @@ // Test. public mlc::where_< mlc_is_a(prop2_type, double) > { - // Super class if test succeed. + // Super class if test succeeds. typedef property2b ret; }; Index: stc/properties.hh --- stc/properties.hh (revision 471) +++ stc/properties.hh (working copy) @@ -88,7 +88,7 @@ }; /// \} -} +} // end of namespace mlc /*------------. @@ -376,7 +376,7 @@ /* FIXME: Don't query from_type directly, but exact_type(from_type) */ \ /* instead. We need mlc::any for this. */ \ template <typename category, typename from_type, typename typedef_type> \ - struct typeof_ \ + struct type_of_ \ { \ /* Look for the typedef as an external type. */ \ typedef typename \ @@ -410,7 +410,7 @@ /// Allow the manipulation of an abstraction (i.e., a template type) /// as a plain type. template <template <typename> class abstraction> - struct is_a + struct abstraction_as_type { template <typename E> struct instantiated_with @@ -418,7 +418,7 @@ typedef abstraction<E> ret; }; }; -} +} // end of namespace stc /*---------. @@ -469,27 +469,30 @@ # define stc_pseudosuper_(T) \ set_pseudosuper_type<T>::ret -// FIXME: s/stc_typeof/stc_type_of/. - -/// Get the property \a Typedef from \a FromType (version to be used -/// inside a template). -#define stc_typeof(Category, FromType, Typedef) \ - typename stc_typeof_(Category, FromType, Typedef) - -/// Get the property \a Typedef from \a FromType (version to be used -/// outside a template). -#define stc_typeof_(Category, FromType, Typedef) \ - typeof_<Category, FromType, typedef_:: Typedef##_type >::ret +// FIXME: Perhaps only ``external'' (i.e., non local) versions of +// stc_type_of are really useful (since they are more precise), and we +// could get rid of local versions (stc_local_type_of and +// stc_local_type_of_). + +/// Get the property \a Typedef, declared in the current namespace, +/// from \a FromType (version to be used inside a template). +#define stc_local_type_of(Category, FromType, Typedef) \ + typename stc_type_of_(Category, FromType, Typedef) + +/// Get the property \a Typedef, declared in the current namespace, +/// from \a FromType (version to be used outside a template). +#define stc_local_type_of_(Category, FromType, Typedef) \ + type_of_<Category, FromType, typedef_:: Typedef##_type >::ret /// Get the property \a Typedef, declared in \a Namespace, from \a /// FromType (version to be used inside a template). -#define stc_typeof_in_namespace(Namespace, Category, FromType, Typedef) \ - typename stc_typeof_in_namespace_(Namespace, Category, FromType, Typedef) +#define stc_type_of(Namespace, Category, FromType, Typedef) \ + typename stc_type_of_(Namespace, Category, FromType, Typedef) /// Get the property \a Typedef, declared in \a Namespace, from \a /// FromType (version to be used outside a template). -#define stc_typeof_in_namespace_(Namespace, Category, FromType, Typedef) \ - Namespace::typeof_<Category, FromType, \ +#define stc_type_of_(Namespace, Category, FromType, Typedef) \ + Namespace::type_of_<Category, FromType, \ Namespace::typedef_:: Typedef##_type >::ret #endif // ! STATIC_PROPERTIES_HH