
On Wed, 08 Jun 2005 02:39:25 +0200 Tobias Schwinger <tschwinger@neoscientists.org> wrote:
OK - if that's what you are trying to do your code look good (in case you said this I must have overlooked it).
BUT: Careful here! The Tag contained in 'function_type_signature' describes the kind of function type as detailed as possible:
is_function_type< function_type_signature< void(*)() >::kind , void(*)(...) >::value
evaluates to 'false', because the tag given to 'is_function_type' is:
non_variadic_defaultcall_function_pointer
while the tag computed from void(*)(...) is
variadic_defaultcall_function_pointer
which is not a subset of the above.
Hmmm. Kinda like getting the most derived type when calling typeid on an instance of a polymorphic class. Interesting. I'm not sure how much I like that, but I'm not sure about the alternatives either...
Curious question: what's the intention behind this ? I dunno. I just thought it was a possible use of the interface. However, one of the thoughts was that I do not necessarily know the tag, but I have a type. Maybe something like iterating through a collection of types, looking for types that are elements of the same type-tag set, so that I can perform some action (like registering that type with some multi-signal mechanism).
One of my mottos is: "If you don't want me to do it, don't provide the interface." Around here, I am known for "breaking" code the first time I use it, because I seem to automatically see uses that were not necessarily intended... it also explains some of the reasons I am so pedantic about docs.