You called the default constructor, from the expression A()
std::for_each could also potentially call A's copy constructor twice (for the pass-by-value parameter and for by-value return), but the first call is optimized out and the return was unused in your case.
(by the way, since you appear to be accumulating a sum, you need to save the return of for_each, or just use std::accumulate)
Incidentally, those template arguments are unnecessary, it's just A result = for_each(s, s+sizeof(s), A());