|
Boost : |
From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2004-07-29 15:09:51
> Please, no more trait blobs! IMO you should separate the traits into
> individual meta functions that works on all function pointer types. For
> instance:
>
> function_arity<T>::type
> Self explanatory.
>
I agree, because of:
- MPL-interoperability
- Currently only the arity-part works on compilers without support for
partial template specialization. This clearly delimits compiler support.
- Including blobs of unused code unnecessarily increases compilation time.
> function_signature<T>::type
> MPL sequence containing all types of the function signature,
> including return type and type of *this if T is a member function
> pointer.
>
Is it a good idea to separate this even further ?
function_return<T>::type
function_input<T>::type
And only valid on member function pointers:
function_this<T>::type
is_const_function<T>::type/value
is_volatile_function<T>::type/value
A 'function_signature' metafunction could then be implemented on top of
these.
As I mentioned in the original post: A function type can exist without
a pointer while a member function type can not.
How to address this ? Handle all three cases or require pointer types ?
I would appreciate any suggestions.
> And while we're at it, why not deprecate function_traits?
>
It was just a -careful- request !
-
Tobias
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk