<div dir="ltr">I think this applies equally to default move operators, I just hadn't done enough homework to be sure yet.<div><br></div><div style>- Lang.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Jan 11, 2013 at 7:20 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><div>On Fri, Jan 11, 2013 at 7:05 PM, Lang Hames <span dir="ltr"><<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>></span> wrote:</div></div></div><div class="gmail_quote">
<div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">At present, if a class contains any Non-POD members we perform element-wise copies for each field when generating the implicit copy-constructor and implicit copy-assignment operator (with an optimization for array members).<div>
<br></div><div>This patch changes this behavior - adjacent POD members will be memcpy'd, with Non-POD members output as usual.</div><div><br></div><div>This is an initial implementation that I'd like to get in tree. Obvious deficiencies are:</div>
<div><br></div><div>It punts entirely when LangOpts.getGC != None.</div><div>It doesn't handle inner classes/unions.</div><div>It doesn't attach any TBAA info, even when all members are the same type.</div>
<div>It isn't particularly smart about when it falls back on element-wise copies (at the moment it emits a memcpy any time it finds more than one POD field).</div><div><br></div><div>These should all be easy to test and remedy once the code's in tree though.</div>
<div><br></div><div>Does anybody see any problems with this?</div><div>Style comments?</div><div><br></div><div>Feedback much appreciated.</div></div></blockquote><div><br></div></div></div><div>This generally seems reasonable to me, but I've not looked at the patch in detail. Any reason not to apply this to move assignment operators too?</div>
<div><br></div><div>Do you handle bitfields? See r151963 for an example of that.</div></div>
</blockquote></div><br></div>