Best to give Callback
a universal constructor:
struct Callback
{
typedef std::function<void(int)> ftype;
ftype fn_;
template <typename T,
typename = typename std::enable_if<std::is_constructible<ftype, T>::value>::type>
Callback(T && f) : fn_(std::forward<T>(f))
{ }
};
(I added the second, defaulted template argument to only enable this constructor for types T
for which the statement makes sense, so as not to create false convertibility properties.) Note how this technique removes one implicit user-defined conversion from the conversion chain, by invoking an explicit constructor for fn_
.