typeof: what to register?

Hi all, Here is a question: besides primitive types, which types/templates should be registered as a part of typeof library? The first candidate is STL. The containers, functors, binders, etc. The STL iterators is a separate question. In most STL implementations they are typedefs, and therefore their template names are non-standard and different. In Dinkumware they are nested classes, and so are the subject to non-deduced context, which prevents them from being registered in a trivial way. Peder does have a solution for this, based on a bug in VC7.1 that allows to work-around non-deduced context (I am personally against using this, although I have to admit that it does the job). So, if we decide to put #ifdefs, based on STL implementation, and *if* we decide to use Peder's solution, it looks like we can take care of all the standard library (including iterators) on the typeof lib level. I have to note here that, if we decide against iterator registration, iterator instantiations can be always registered as needed, by the end user: BOOST_TYPEOF_REGISTER_TYPE(MyClass) BOOST_TYPEOF_REGISTER_TYPE(std::vector<MyClass>::iterator) I think if other libraries want to be supported by typeof (like Spirit, for example), those libraries should register their types/templates themselves (just because of synchronisation issue). Any help would be provided, of course. I would greatly appreciate any opinions on the subject. Regards, Arkadiy

Arkadiy Vertleyb wrote:
Hi all,
Here is a question: besides primitive types, which types/templates should be registered as a part of typeof library?
The first candidate is STL. The containers, functors, binders, etc.
If the registration is done on a per-header basis, I support that. IOW, if you want registered types for things declared in <iterator>, you #include <boost/typeof/std/iterator.hpp> or something. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

"David Abrahams" <dave@boost-consulting.com> wrote
Here is a question: besides primitive types, which types/templates should be registered as a part of typeof library?
The first candidate is STL. The containers, functors, binders, etc.
If the registration is done on a per-header basis, I support that. IOW, if you want registered types for things declared in <iterator>, you
#include <boost/typeof/std/iterator.hpp>
What is your major concern here? Do you want to avoid the inclusion of all STL headers? We might be able to use forward declarations to cure this... Or do you want to avoid unnecessary encode/decode specializations? Arkadiy
participants (2)
-
Arkadiy Vertleyb
-
David Abrahams