The problem is not exactly as the question. The real question is: why did my code work?
I posted this question on stackoverflow->make objects in function arguments. What I asked is whether you can do something similar to:
....
// java code
Obj o1 = new Obj(new Objectt()); // we made and passed a new object in a function argument
// OR
returned = function_does_something(new objeect());
....
in c++? I.e .
returned = function_does_something(new objectt()); // possible in c++?
Note that in the question I asked (link above), the following code worked
store.insert(store.begin(), vector<int>({key, value})); // type(store) = vector<vector<int>>
What I had thought during that time was that: call constructor to obtain a new object.
vector<int>({values})
was the constructor I called. But in c++, a constructor does not return anything, right? So why did the code work?