Date: Sun, 29 Jun 2014 13:21:21 -0300 From: Agust?n K-ballo Berg?
To: boost-users@lists.boost.org Subject: Re: [Boost-users] [fusion] maps and arrays Message-ID: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
I missed the part where `for_each` was invoking the callable on each element of the array, that is not how it is supposed to be. You are right that making a recursive callable is the correct way to obtain that behavior.
Hi Agustin I'm sorry for taking so long to reply to you. I've been swamped. I really appreciate you taking the time to have this discussion with me and helping me to see that the behavior I was experiencing before with the for_each stepping into each array item is not correct. I should remember in the future to try and understand from the documentation what something is doing and not just by empirically testing it.
Without any other information on the error you get, I'm betting that this is due to adding support for C++11 (not-so) perfect forwarding:
void foo(std::array
const&){}
template <typename T> void bar(T&& v){ foo(std::forward<T>(v)); }
foo({3,4}); // ok bar({3,4}); // error: {3,4} has no type
If I get some time I will play with this. I think that it is a bug that I cannot use braced initializer in c++11 with 1.55 like I could in 1.53. In the meantime I am adding a comment and referencing this discussion to my bug report to show that it is not a bug. I imagine they are not interested in the 1.53 issue we may have uncovered. Regards, Steven