On Sunday, 25 August 2013 at 19:01:14 UTC, monarch_dodra wrote:
On Sunday, 25 August 2013 at 14:50:16 UTC, Paolo Invernizzi
wrote:
Hi all,
--
I didn't fully investigate, but my guess is that you are seeing
emplace bugs. Basically, *array* first allocates an array
containing noise, and then tries to emplace data onto there.
Unfortunatly, emplace does it wrong, calling "opAssign" when it
shouldn't.
Further, SysTime is implemented (AFAIK), as a rebindable, which
has an elaborate opAssign. This means that when you call
emplace, it calls opAssign, which triggers your invariant,
which fails, since data is just noise. This is why commenting
out that data member also avoids the bug.
I'd tell you I have an open pull request that fixes it, but its
been stuck without review for *months*.
Thank you for the explanation, very appreciated: I've found your
pull request, and I'm adding a comment pushing for an inclusion.
(some bug number to vote up?)
It's not easy to get familiar with ranges and templates, and that
kind of bugs turns sometimes using Phobos facilities like walking
in a minefields!
I've another question: why the opAssign in SysTime is triggering
the invariants in the enclosing struct? I mean, they nest also in
this case?
Thank you
- Paolo Invernizzi