|
Boost Users : |
Subject: Re: [Boost-users] [fusion]Is it possible to wrap a function template into a function object?
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-08-12 02:36:40
On 8/12/2011 12:23 PM, Gordon Woodhull wrote:
>
> On Aug 11, 2011, at 11:15 PM, someguy wrote:
>
>> template<template<typename T0> class F>
>> struct temp_fun_1
>> {
>> template<typename TT0> void operator()( TT0 a1 )
>> {
>> // empty function for simplicity
>> }
>> };
>>
>> template<typename T> void Loopback(T t){ std::cout<<t; }
>>
>> temp_fun_1<Loopback>(); //in main(). I can't even instantiate
>> temp_fun_1.
>
> (Please post as plain text.)
>
> I think the essential problem is that you'd have to have a template parameter which takes
> a function template, which can't be done:
>
> http://groups.google.com/group/comp.std.c++/browse_thread/thread/64738c5af5bcaf04
Just use a plain, ol' macro to make a simple PFO wrapper ;-)
Regards,
-- Joel de Guzman http://www.boostpro.com http://boost-spirit.com
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