
On Tuesday 04 September 2012 06:00:39 Mathias Gaunard wrote:
On 03/09/2012 09:08, Andrey Semashev wrote:
I realize that I can provide both result<> specializations and it will work either way. But when there are more than one argument the specializations begin to pile quickly. Consider also rvalue references and const and non-const qualified my_foo.
I have yet to find a good way to do this myself. It seems it is an issue that really needs some written best practices though, since a lot of libraries that define result appear to not to it vert well (sadly, even Phoenix is among them; it uses more specializations than necessary and simple things like result_of<F(int, int, int&)> are ill-formed).
Yes, actually, I started asking these questions while I was working with Phoenix. :) Jeffrey have suggested a good solution in his reply. I think it can be described in the result_of docs to resolve the confusion in the future. I can update the docs if noone objects.