[PATCH] D25342: Turn cl::values() (for enum) from a vararg function to using C++ variadic template

Eric Fiselier via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 8 03:00:06 PDT 2016


EricWF added inline comments.


================
Comment at: llvm/include/llvm/Support/CommandLine.h:594-595
+/// as an initializer list to the ValuesClass constructor.
+template <typename... OptsTy> ValuesClass values(OptsTy... Options) {
+  return ValuesClass({Options...});
 }
----------------
EricWF wrote:
> mehdi_amini wrote:
> > zturner wrote:
> > > Is this going to give you unwanted copies?  Is there any difference if you take the parameter pack by rvalue reference?
> > I expect copy-elision to kick-in anyway, but I can use universal reference as well.
> Isn't moving a `OptionEnumValue`  equivalent to moving it anyway? 
Isn't moving a OptionEnumValue equivalent to copying it anyway?


https://reviews.llvm.org/D25342





More information about the llvm-commits mailing list