Q:

C++ Create vector or list from argument parameter packs

I am looking for a solution, to compose arguments of User objects into an iterable std::vector or std::list
auto user_group = create_user_group(User(), User(), User(), User());

Example
template <typename ...Users>
auto create_user_group(Users&&... users)
{
    return std::vector<Users...>{std::forward<Users>(users)...};
}

Error
error: wrong number of template arguments (4, should be at least 1)
  return std::vector<Users...>{std::forward<Users>(users)...};

A:

You need to separate a single argument to pass to std::vector:
template <typename User, typename ...Users>
auto create_user_group(User &&user, Users&&... users)
{
    return std::vector<std::decay_t<User>>{
        std::forward<User>(user), std::forward<Users>(users)...
    };
}

A:

If "Users" have different types then you need a type list.  Fortunately, C++ has tuple that can be used as a type list:
template <typename ...Users>
decltype(auto)
create_user_group(Users&&... users) {
  return std::make_tuple(std::forward<Users>(users)...);
}

Live Demo

