On 05/06/2014 8:56 PM, Philippe Sigaud via Digitalmars-d-learn wrote:
enum b = DataAndView(1);
assert (!sameTail(b.data, b.view));
I suppose it's because enums are manifest constants: the value they
represent is 'copy-pasted' anew everywhere it appears in the code. So
for arrays and associative arrays, it means recreating a new value
each and every time.
In your case, your code is equivalent to:
assert (!sameTail(DataAndView(1).data,DataAndView(1).view));
And the two DataAndView(1), being completely separated, do not have
the same tail.
Ah, Isee, that does kinda make sense ^^ A re-factoring we go...
A...