9 ms·
Where functional programming in C++ falls apart is this step: bind(std::plus<int>(), _1, bind(&Die::faceValue, _2)) When I first learned the STL, I worked p
by tman 16y ago
Where functional programming in C++ falls apart is this step:
bind(std::plus<int>(), _1, bind(&Die::faceValue, _2))
When I first learned the STL, I worked pretty hard to figure out bind, etc., and get rid of all my for loops. The problem is that it doesn't actually buy you that much. The for loop is uglier, but simpler to maintain, read, and debug.
Luckily the lambda syntax from the new standard already appears to be available in experimental gcc. This is going to be a game-changer.
- rubashov 16y agoThe lambda stuff is in g++ 4.5, which is a stable release, right? It's not really experimental.
- tman 16y agohttp://gcc.gnu.org/gcc-4.5/cxx0x_status.html http://gcc.gnu.org/gcc-4.5/cxx0x_status.html : "Status of Experimental C++0x Support in GCC 4.5" Last month's release of 4.5.0 is stable, but the C++0x support is experimental.
- deleted 16y ago[deleted]
- DCoder 16y agoLambdas are also supported in MSVC++ 2010.