<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Nov 12, 2017 at 11:45 PM, Nikodemus Siivola via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">A solution requiring no compiler support is to wrap the little endian values in a struct.<div><br></div><div>template<typename T></div><div>struct little_endian {</div><div>    little_endian(T value) : _value(value) {}<br>    T _value;</div><div>    T convert() { </div><div>       // conversion here</div><div>    }</div><div>};<br><br></div></div></blockquote><div><br></div><div>That requires a lot more compiler support than C gives you ;-)   (The need for C wasn't explicit in the message body, I think, but it's in the subject line.)</div><div><br></div><div>-- James </div></div></div></div>