Boost logo

Boost Users :

Subject: Re: [Boost-users] Bind/Function: use reference arguments in template variadic functions
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2013-04-12 10:27:15


AMDG

On 04/12/2013 03:41 AM, Yannick POTIN wrote:
>
>> template<class ...classes>
>> boost::function0<void> call_something(classes&... c)
>
> Thank you, It actually allows me to use references in these functions.
> I just tried and g++ is waiting for only references but I need to use pointers and/or values too.
> There is a way to use mixed types in template variadic functions ?
>

For perfect forwarding use:

template<class... T>
void call(T&&... t)
{
    foo(std::forward<T>(t)...);
}

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net