Hi I have a problem with boost::function in association with template.
I have a gain function declaration declare as this..
template <
template
class CONT,
typename T,
typename U
>
long double gain(const CONT >& data,
const T& attr, const T& target_attr);
// old signature does compile
template <
template
class CONT,
typename T,
typename U
>
boost::any ID3(
const CONT >&,
const T&,
const CONT<T> &,
boost::function >&, const T&, const T&) >
);
// new signature DOES NOT compile.
template <
template
class CONT,
typename T,
typename U
>
boost::any ID3(
const CONT >&,
const T&,
CONT<T> *,
boost::function >&, const T&, const T&) >
);
In the main file i have things pass as this.
// old way of passing works with old signature
boost::any tree(
MyAnn::ID3(data,
target_attr, attribute,
MyAnn::gain)
);
// line 76 to 82.
boost::function&, const
std::string&,
const std::string&)> gainfunc;
gainfunc = MyAnn::gain;
boost::any tree(
MyAnn::ID3(data,
target_attr, boost::addressof(attribute),
gainfunc)
);
I compile the file and get teh following errors. Can anyone tell me
why changing the orginial signature from const CONT<T>& to CONT<T> *
all of sudden breaks the code. Thanks.