- Joined
- 12/14/10
- Messages
- 131
- Points
- 38
More than two levels of f(g) is becoming academic.
I don't know about that. Genetic programming off the top of my head seems like it could conceivably use arbitrary levels of compositions.
In fact, this caught my attention because this is what they were trying to do at the last (FT) job I had: The boss had an idea that objects representing things such as stochastic processes could be built up from simple "building blocks" (and it certainly is possible). The thing was they were using C# objects, so that every composition of two objects to form a new one necessarily added an additional level of indirection (since all C# objects are polymorphic).
I redid it using boost::accumulator, which through TMP is able to compose operations with no indirection (though it probably implicitly relies on inlining as in @Polter 's example above).
So this is apparently an example of something than can be done feasibly in C++ but not in C#.