c++ template instantiation duty template parameters
i have following problem controlling template instantiation [*].
file foo.h
class foo
{
public:
template <typename f>
vacant func(f f)
private:
int member_;
};
file foo.cc
template <typename f>
foo::func(f f)
{
f(member_);
}
file caller.cc
foo::func(boost::bind(&bar::bar_func, bar_instance, _1));
while compiles fine, linker complains an capricious symbol:
void foo::func<boost::_bi::bind_t...>
how i instantiate function foo::func? given takes duty argument, i am small bit confused. i attempted supplement an instantiation duty foo.cc, i am used unchanging non-function types:
instantiate()
{
template<> vacant foo::func<boost::function<void(int)> >(boost::function<void(int)>);
}
obviously, does work. i conclude someone indicate me right direction.
thanks!
[*] yes, i review parashift faq lite.
Comments
Post a Comment