quote:Original post by Lord Bart
That is the problem, specialization it can''t!
You are wrong.
quote:std:copy does not have the info needed in order to determine if it can specialize to a memcpy.
Of course it does.
quote:It is a templated function and is made as generic as possible to work with all std container classes and arrary of classes/structures or primitives.
It is precisely through being a function template that it knows enough.
quote:How is it to know it was passed only primitives?
Because it can see the types being used. It can see, for example, that the input range is defined by pointers to primitives and likewise the output range.
quote:
So the only hope it has to work with all things passed to it is to do a loop with assignment on each element.
Be quiet.