Hi friends, I'm looking for some stuff like the Loki::TypeTraits. I presume that there should be some similar ones in the boost repository. If I'm right, please tell me where they are. Thanks, --Hossein __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
Hossein Haeri wrote:
I'm looking for some stuff like the Loki::TypeTraits.
I presume that there should be some similar ones in the boost repository.
Yep, and they are also on their way to standardization - http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1424.htm
If I'm right, please tell me where they are.
Any reasonably recent Boost distribution contains "boost/type_traits" directory which is full of the kind of templates you are looking for :). The docs are available here - http://www.boost.org/libs/type_traits/index.htm Aleksey
Dear Aleksey,
Yep, and they are also on their way to standardization -
http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1424.htm Oh that's a cool link! Thanks a lot.
If I'm right, please tell me where they are.
Any reasonably recent Boost distribution contains "boost/type_traits" directory which is full of the kind of templates you are looking for :). The docs are available here - http://www.boost.org/libs/type_traits/index.htm
Thanks again, --Hossein __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
Aleksey Gurtovoy wrote:
Yep, and they are also on their way to standardization - http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1424.htm
One question: Why does is_enum require compiler support? Or is this a typo? Regards, Daniel -- Daniel Frey aixigo AG - financial training, research and technology Schloß-Rahe-Straße 15, 52072 Aachen, Germany fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 eMail: daniel.frey@aixigo.de, web: http://www.aixigo.de
Yep, and they are also on their way to standardization - http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1424.htm
One question: Why does is_enum require compiler support? Or is this a typo?
It comes down to a late breaking request from the MPL guys that the type traits templates work with incomplete types, and or class templates which can not be instantiated: "Instantiation of template arguments There have been requests from the authors of boost's MPL that the proposal document whether instantiation any of the unary traits class templates in this proposal will result in the instantiation of a template argument that is itself a template-id (there are some metaprogramming idioms [11] where it is important that instantiation does not occur). Section (14.7.1) implies that if it is a precondition that the a template argument be a complete type (because the semantics of the class depend upon it), then instantiation of that argument (if it is a template-id) is essential in order to determine whether the type has a specific property or not. Similary, for those class templates that do not mandate that the template argument(s) are complete types, there are nonetheless implementations that may require that the type is a complete type (for example is_enum and any other templates that rely upon it). Therefore, mandating that these templates work with incomplete types or with template-id's which can not be instantiated, results in compiler support being required where it was not required before. Nonetheless MPL's authors believe that this is a sufficiently important problem that some wording requiring traits class templates not to instantiate their template arguments has been added, albeit with latitude permitting instantiation to occur as a temporary workaround until such time as compiler support becomes available." Without these requirements is_enum can indeed be implemented within the language. John
John Maddock wrote:
One question: Why does is_enum require compiler support? Or is this a typo?
It comes down to a late breaking request from the MPL guys that the type traits templates work with incomplete types, and or class templates which can not be instantiated:
Ah, OK. Thanks, Daniel -- Daniel Frey aixigo AG - financial training, research and technology Schloß-Rahe-Straße 15, 52072 Aachen, Germany fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 eMail: daniel.frey@aixigo.de, web: http://www.aixigo.de
participants (4)
-
Aleksey Gurtovoy
-
Daniel Frey
-
Hossein Haeri
-
John Maddock