I am not able to get this to work:
template<class Input, class Output, class Index>
size_t pack(void (*copy)(Input, Input, Output),
size_t N, Input input, Output output,
const Index &index);
size_t K = pack(&std::copy<const double*,double*>,
M, C.data().begin(), C_.data().begin(),
index.host);
compiler message I get tells me that copy is not resolved, instead I get
unresolved overloaded function type>.
what am I doing wrong?
thank you
You could make a design change. One might be make the return type a separate template parameter:
The return type is deduced (and subsequently ignored by your code.) The other option, which I would recommend, would be to accept any generic function type:
This doesn’t enforce any specific signature, and provides the most flexibility.