
On Tuesday 24 July 2012 00:56:07 Julien Nitard wrote:
2. In the same section, I didn't really understand the second code snippet.
Why is the tuple needed? Why not this: any<requirements, _a> a = &array[0]; a = a + 2;
Also, from the implementation perspective, will it simply add 2 to the pointer or construct an "any" from 2 and then perform the addition?
My 2cts: I think this is because the return type depends on the 2nd operand in the most general case.
Well, If my understanding is correct, according to the "requirements" typedef, the result should be an "any" containing an object of the same type as the left argument (which is the pointer in this case). If there is a way to describe the operator when the result type differs from the both argument types, the mentioned example doesn't show that. Actually, is this possible with the library?