I have two questions
-
Are both of these declarations of setEvalFunction equivalent for
using EvalFunctionPtr = T (*)(const std::vector<T>&);
?a) void setEvalFunction(const EvalFunctionPtr& evalFunc); b) void setEvalFunction(T (* const &evalFunc)(const std::vector<T>&));
-
What is the difference between the following parameters (since both seem to work fine).
a) T (* const &evalFunc)(const std::vector<T>&) b) T (* const &evalFunc)(const std::vector<T>&)&
I want to have something equivalent to 1 a), i.e. passing a reference to a constant function pointer, but without using some extra definition like using EvalFunctionPtr = ...
.
Aucun commentaire:
Enregistrer un commentaire