Boost logo

Boost :

Subject: Re: [boost] [type_traits][function_types] Discard param const qualification, bug or feature?
From: Jonathan Wakely (jwakely.boost_at_[hidden])
Date: 2013-09-30 15:49:44


On 30 September 2013 20:22, Mostafa wrote:
>
> I should have been more specific, bar is some member function of T. So in
> Foo:mybar, the goal is to reconstruct T::bar's paramtypes as "efficient
> types". That's what the other person's post was also referring to. So if a
> client passes the following struct as a template parameter to Foo:
>
> struct ClientClass
> {
> static void bar(int const) { ... }
> };

You're presenting this class as having a function of that type, but it
doesn't, your example is:

struct ClientClass
{
  static void bar(int) { ... }
};

> the library is able to instantiate the following Foo::mybar
>
> void Foo::mybar(int const & x) { ClientClass::bar(x); }

Why do you choose a different "efficient type" for an 'int' parameter
vs a 'const int' parameter?


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