<div dir="ltr">yep SFINAE'll do, I think - though I believe you can use "enable_if<x" wherever you use "enable_if_c<x::value" as a minor convenience/shortening</div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Mon, Jan 20, 2014 at 5:54 PM, Nick Kledzik <span dir="ltr"><<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">ping?<div class="im"><div><br><div><div>On Jan 15, 2014, at 12:53 PM, Nick Kledzik <<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>> wrote:</div><blockquote type="cite">
<div style="word-wrap:break-word"><div>Good point.  I conditionalized (enable_if_c<>) the templates to only work with POD types.  Updated patch:</div><div><br></div><div></div></div>
<br></blockquote></div></div></div></div>
<br><div style="word-wrap:break-word"><div><div><blockquote type="cite"><div style="word-wrap:break-word"><div></div><div><br></div><div>-Nick</div><br><div><div>On Jan 15, 2014, at 11:46 AM, <a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a> wrote:</div>
<blockquote type="cite">I don't know enough about BumpPtrAllocator's design/intended use to know how well these new APIs fit - but both the templated forms are unsafe for non-trivial types (ArrayRef<std::string> for argument's sake) which is a bit scary - at least they could have some static assert/SFINAE/something to limit their use to safe cases if they aren't going to be generalized.<br>

<br><div>On Tue Jan 14 2014 at 1:32:28 PM, Nick Kledzik <<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

It is easy to use BumPtrAllocator with placement-new to allocate and initialize a C++ object, but it is harder to allocate and copy other types with BumpPtrAllocator, such as StringRef.  I did not see any helper utils to do that, so I wrote this patch.  I added a few variations of allocateCopy() which each make allocating and copying different types easier.<br>
</blockquote></blockquote></div><br></div>
_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>
<br></blockquote></div><br></div>