map in a stack

taking a map stl in the stack??
is it allowed??
stack < map <int,string> > s1

1 Like

Yes, why not! Those maps inside stack can have stacks and those stacks can have maps and this can go on and on and it will still be valid. The reality is inception :smiley: