Chain C++11 pattern by accumulate functions