`Input: 1, 2, 3, 4`

`Output: 2, 3, 4, 1`

**My solution:** [play with my code](https://godbolt.org/z/6rYq9K)

```
template <typename T, typename ... Param>
void rotate(T* first, Param* ... params) {
    std::vector<T*> tmp = {first, params...};
    if (tmp.size() <= 1) {return;}
    T f = *first;
    for (size_t i = 1; i < tmp.size(); ++i) {
        *tmp.at(i - 1) = *tmp.at(i);
    }
    *tmp.at(tmp.size() - 1) = f;
}

```

I would like to rotate any number of elements as described above. My solution seems to work, but in my eyes, it's not very "elegant". I do not like that I have to initialize a vector here. Is there a way to accomplish the same thing without the vector? Maybe with recursion?

Ideally, I would also like to pass references instead of pointers.