
"Tobias Schwinger" <tschwinger@neoscientists.org> wrote
Arkadiy Vertleyb wrote:
"Tobias Schwinger" <tschwinger@neoscientists.org> wrote
// [...]
--- at the end of every source file:
#if defined(<LIB>_TYPEOF_SUPPORT) # include <boost/<LIB>/typeof_support.hpp> #endif
^^^^ The conditional could be factored out into another header file...
OK, understand. The last lines above make this solution intrusive, and
#3
is intrusive as well...
Why is "intrusiveness" undesirable in this context?
1) A library may be targeted for inclusion into the Standard, in which case it would not be appropriate for it to depend on typeof. 2) The typeof library is a temporary solution. Once the typeof operator is in the Standard, and is implemented by the compiler vendors, and Boost no longer supports any legacy compiler with no native typeof, the registration stuff will need to be removed. It's a little easier to do if done non-intrusively. 3) It might be nice to have a similar scheme for Boost libraries and for the Standard Library. The latter, obviously, can't be done intrusively.
2)
+ library authors can freely choose the granularity level for doing the registration + it can be used in combination with #1 in cases where more fine grained control over Typeof support makes sense - it's quite complicated
- it introduces unnecessary dependencies -- when a type is added/changed this is reflected in the header that is used by the clients having nothing to do with this type. Regards, Arkadiy