For example, std::shuffle
does accept its random number generator by universal reference.
It would seem like a good idea and non-breaking to change the prototypes of any algorithm accepting a predicate to accept its functor by universal reference, or am I missing something.
I also can't seem to find a proposal suggesting this, nor a defect report about it being forgotten for ... C++11. Does anyone know more about this?
As a small/tiny example that shows a case where using forwarding references over functor by value: http://ift.tt/2BnBVdH.
Aucun commentaire:
Enregistrer un commentaire