|
Boost : |
From: Steven Watanabe (steven_at_[hidden])
Date: 2006-11-28 18:57:03
AMDG
Tobias Schwinger wrote:
> Actually,
>
> function_type< int(...), tag<components<int(...)>, stdcall_cc>
> >::type
>
> is equivalent and doesn't read too bad, does it?
>
I was concerned more about the duplication of int(...).
here is a contrived example.
template<class M, class V, class I>
struct get_function :
function_type<
typename mpl::at<M, typename mpl::at<V, I>::type>::type,
tag<
components<
typename mpl::at<M, typename mpl::at<V, I>::type>::type
>,
default_cc
>
> {};
Of course a simple template could fix this:
template<class F, class Tag>
struct mutate_function :
function_type<F, tag<mpl::if_<is_callable_builtin<F>, components<F>,
F>::type, Tag> > {};
>
>>
>> > > How often are the cv tags likely to be used? They are redundant
>> > since for member functions this information is already available
>> > in the first parameter. If they are not a very common thing to
>> > need, I would propose simply removing them from the interface.
>>
> It might not be wise to throw out that feature. Currently cv-qualified
> function types are illegal, but it is likely they will be allowed in
> some contexts in the future (there is a defect report on that part of
> the standard).
shouldn't that be handled by add_const/is_const?
> Further, these tags might come handy to work around BCC deficiencies.
I hope that would be an implementation detail.
In Christ,
Steven Watanabe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk