【注意】STLの落とし穴【危険】
■ このスレッドは過去ログ倉庫に格納されています
0796デフォルトの名無しさん
2011/05/29(日) 01:17:52.281 Effects: Computes its result by initializing the accumulator acc with the initial value init and then modifies
it with acc = acc + *i or acc = binary_op(acc, *i) for every iterator i in the range
[first, last) in order.262)
2 Requires: T must meet the requirements of CopyConstructible (20.1.3) and Assignable (23.1) types.
binary_op shall not cause side effects.
マジだorz
>acc = acc + *i or acc = binary_op(acc, *i) for every iterator i in the range
つまりaccの型がintだといくらdoubleを足しても小数点以下は切り捨てか
■ このスレッドは過去ログ倉庫に格納されています