vaibhava96 vaibhava96 - 6 months ago 36
C++ Question

looping through a deque recursively c++

I am trying to create a function that takes in a deque of integers as a parameter, loops through each element one by one, and returns the deque recursively. I have found a few previous posts on StackOverflow that do something similar, but I am unable to understand what is happening in their answers. I am relatively new to C++. Help is greatly appreciated.


it should be something like this

deque <int> x;
void Calc (deque <int> d){
    if (d.empty()) return;