c++ push reference node to stl list

how does one push_back into list nodes by reference? so when I need to set fields in object both structors will be updated

You cannot, unless your list is templated to contain pointers (or even better smart pointers).

None of the standard library containers are able to contain references directly.

Browse More Popular Posts

Leave a Comment