| Re: How to convert a pointer to member function type to a const member one |
|
 |
|
 |
|
 |
|
 |
Group: comp.lang.c++.moderated · Group Profile
Author: Roman.PerepelitsaRoman.Perepelitsa Date: May 6, 2008 06:30
On 6 May, 08:57, mcostalba gmail.com> wrote:
> Thanks Roman for your link.
>
> Actually there are some good ideas in that implementation and I will
> try to borrow a few of them...
>
> Unfortunatly it does not fit the bill 100%%, indeed:
>
> - Implicit argument type conversion should be avoided in my context,
> due to some ambiguites that can arise when there is more then one
> candidate among the overload set. So signature matching would be ok to
> be strict.
> - It seems you have to add a specialization for each argument arity,
> in my implementation I would try to avoid this.
Yes, you can use variadic templates (if your compiler supports then)
or boost::preprocessor to automate generation of specializations.
> Anyhow, for interested people, many of the ideas, included overloading
> comma operator
>
> template
> U& operator,(U&, void_exp_result);
>
> to workaround void return types are also exposed in "Detecting the
> Arity of Function Objects"
>
> under the link
>
> http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost_proto/...
>
> where an equivalent solution is documented by Eric Nibler in his
> boost::proto library.
Nice one, I haven't seen it. It uses clever trick with conversion to
a function pointer.
IMHO, it would be nice if someone added is_call_possible and
is_exact_call_possible to boost.
Roman Perepelitsa.
|