Boost logo

Boost :

Subject: Re: [boost] [type_traits][function_types] Discard param const qualification, bug or feature?
From: Rob Stewart (robertstewart_at_[hidden])
Date: 2013-09-30 08:24:45


On Sep 29, 2013, at 11:00 PM, Mostafa <mostafa_working_away_at_[hidden]> wrote:

> On Sun, 29 Sep 2013 14:44:52 -0700, Sergey Zhuravlev <sergey4zhuravlev_at_[hidden]> wrote:
>
>> Signature type int(int, const std::string) can be used as parameter for some compiletime algorithm. For example, algorithm that generate new signature type with optimal transfer arguments int (int, const std::string&) or generate signature with all argument references int (int&,
>> const std::string&)
>
> That was exactly the use case and the problem I had. Fortunately for me, I was able to specify the return type and parameters_type (as an mpl::vector) separately, which solved the issue. But I don't know if this is doable in general. For example, what does one do in the following scenario:
>
> template <typename T>
> struct Foo
> {
> void mybar( // Construct efficient argument transfer signature for T::bar )
> { T::bar(....); }
> };
>
> without forcing the user to seperately specify T::bar paramtypes as a separate template parameter?

#include<boost/call_traits.hpp>
...
boost::call_traits<typename T::bar>::param_type

___
Rob

(Sent from my portable computation engine)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk