<div class="gmail_quote">On Sun, Jan 29, 2012 at 1:16 PM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Chandler / Matthieu: I tried that - it gets rid of the copy<br>
constructor error, but since the volatile is casted away, the<br>
Wnull-dereference warning reappears.</blockquote><div><br></div><div>Sorry I had a typo in my example, but we did in fact place the const cast on the reference, not on the pointer. That is what silences the warning:</div>
<br>return const_cast<typename remove_reference<T>::type&>(*static_cast<volatile typename remove_reference<T>::type*>(0));<div><br></div><div>(I had the '*' in the wrong place last time)</div>
<div><br></div><div>Anyways, I'll try out the abort variation. I do like that much more.</div></div>