<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 5, 2017 at 5:26 PM Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Oh yea, I forgot about that issue.<div><br></div><div>I know it is possible to have a parameter pack not be the last argument, so maybe it would work?  e.g.</div><div><br></div><div>template<typename... Args></div><div>StringSwitch &Cases(Args &&... args, T value)</div></div></blockquote><div><br>I think that's possible but doesn't deduce the varargs (only works if the template parameters ar explicitly specified) - I could be wrong, though.<br><br>The other way to do this is to SFINAE things (probably want to SFINAE all the args to be Cases anyway).<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 5, 2017 at 5:19 PM Rui Ueyama via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ruiu added a comment.<br>
<br>
IIRC, it is tricky to use a template because all but the last parameter are of the same in `Cases`. If it takes `Value` as the first parameter, it would have been easier to use a template. But I'm not a C++ expert, so there may be a straightforward way of doing it.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D24882" rel="noreferrer" target="_blank">https://reviews.llvm.org/D24882</a><br>
<br>
<br>
<br>
</blockquote></div>
</blockquote></div></div>