Your code is wrong in many places. In short, exceptional situation should leave your object in correct state. E.g. the following is invalid:

_payload += stuff;
mixin(runCheckCode());

while the following is correct:

T tmp = _payload + stuff;
mixin(runCheckCode());
_payload = tmp;

There is a great book about Exception Safety by Scott Meyers, I highly recommend reading it. At the very least read this:
http://en.wikipedia.org/wiki/Exception_handling#Exception_safety

Reply via email to