I think that constructor with universal reference parameter has better performance than the one without reference.
From cppreference (https://en.cppreference.com/w/cpp/utility/functional/function/function), we can see that the template constructor for std::function
is not using reference.
template< class F > function( F f );
Is it a mistake? If not, why the standard doesn't requires the constructor use universal reference?
Aucun commentaire:
Enregistrer un commentaire