Selecting variable amount of vector elements in C++
You can avoid problems related to variadic macros and problems related to C-style variadic functions altogether by creating a function that takes an std::initializer_list directly:

template&lt;class T&gt;
std::vector&lt;T&gt; select(const std::vector&lt;T&gt;&amp; vec, std::initializer_list&lt;std::size_t&gt; indices)
{
    std::vector&lt;T&gt; ret;
    for (std::size_t ind: indices) 
    {
        ret.push_back(vec.at(ind));
    }
    return ret;
}


Moreover, it is the easiest to read of the three implementations.