How do I use for_each to output to cout?

后端 未结 5 1465
没有蜡笔的小新
没有蜡笔的小新 2020-12-23 14:58

Is there a more straight-forward way to do this?

for_each(v_Numbers.begin(), v_Numbers.end(), bind1st(operator<<, cout));

Without an expli

5条回答
  •  萌比男神i
    2020-12-23 15:55

    Another option — Boost.Lambda.

    for_each(v.begin(), v.end(), cout << boost::lambda::_1);
    

提交回复
热议问题