dimanche 27 septembre 2015

Efficiently print the reverse of an std stack

I am trying to override the << operator for a class that contains an attribute of type std stack. I need to print the values of this stack in a reverse order. Is there any way to do this without copying the elements in a temporary variable ?

friend std::ostream& operator<< ( std::ostream & os, 
                                  const stackClass & p_stackClass)

Aucun commentaire:

Enregistrer un commentaire