<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div><div>On Sep 3, 2013, at 11:52 AM, Benjamin Kramer <<a href="mailto:benny.kra@gmail.com">benny.kra@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>On 03.09.2013, at 20:46, Matthias Braun <<a href="mailto:mbraun@apple.com">mbraun@apple.com</a>> wrote:<br><br><blockquote type="cite">Currently I see these options:<br><br>1:<br>live with a freestanding struct LiveInterval;<br><br>2:<br>class LiveIntervalBase {<br>public: struct Segment {};<br>};<br>template <> struct isPodLike<LiveIntervalBase::Segment> /* … */<br>class LiveInterval : public LiveIntervalBase {<br>public:<br>  SmallVector<Segment> /* … */<br>};<br><br>3:<br>/** please do not use directly but LiveInterval::Segment */<br>struct LiveSegment { /* … */ }<br>template <> struct isPodLike<LiveSegment> /* … */<br>class LiveInterval {<br>public:<br> typedef LiveSegment Segment;<br> SmallVector<Segment> /* … */<br>};<br><br>4: Drop the isPodLike, no idea if/how badly it affects performance<br></blockquote><br>When compiling with Clang we use the is_trivially_copyable type trait as a base line for isPodLike. That should be sufficient for the Segment class. Not sure if we care enough about performance on other compilers.<br></div></blockquote><div>Indeed, sounds like a good enough reason to drop isPodLike here, IMHO.</div><div><br></div><div>Matthias</div><br><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>- Ben<br><br><blockquote type="cite"><br>Greetings<br><span class="Apple-tab-span" style="white-space: pre;">   </span>Matthias<br><br>On Sep 3, 2013, at 11:39 AM, Jakob Stoklund Olesen <<a href="mailto:stoklund@2pi.dk">stoklund@2pi.dk</a>> wrote:<br><br><blockquote type="cite"><br>On Sep 3, 2013, at 11:30 AM, Matthias Braun <<a href="mailto:mbraun@apple.com">mbraun@apple.com</a>> wrote:<br><br><blockquote type="cite">Sounds good. Though I’m having trouble make Segment an inner class of LiveInterval:<br>I need to specialize the isPodLike type constraint class. But apparently c++ forces you to specialize templates at the same scope where the template was specified, so it is only possible<br>to do that after the LiveIntervall class, where it is too late, because the SmallVector<Segment> has already been instantiated.<br>So I guess I have to create a LiveSegment class outside LiveInterval, unless I’m missing some C++ tricks here…<br></blockquote><br>Oh, for crying out loud! Maybe some of our C++ wizards can help?<br><br>I wonder, though, if isPodLike does any good? Could we just drop it?<br><br>Thanks,<br>/jakob<br><br></blockquote><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</blockquote></div></blockquote></div><br></body></html>