Changes between Initial Version and Version 1 of Ticket #7748
- Timestamp:
- Sep 10, 2013, 8:35:08 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #7748 – Description
initial v1 1 1 Code like the following doesn't work trunk (and released) transformed: 2 2 3 4 {{{ 3 5 std::vector<int> myList(...); 4 6 float sum = boost::accumulate(myList | transformed([](int a) { return a * 5; }), 0.f); 7 }}} 8 5 9 6 10 The following patch & test modifications allow the following syntax: 11 12 {{{ 7 13 float sum = boost::accumulate(myList | transformed<float>([](int a) { return a * 5.f; }), 0.f); 14 }}} 15 8 16 9 17 This wouldn't be a problem if result_of used or fell back to decltype, but it seems that won't be available for a while. The proposed syntax could also be helpful when using transformed with functors whose implementations are both unmodifiable and don't follow result_of.