Archived

This topic is now archived and is closed to further replies.

dave

A Question regarding a line of code in the enginuity tutorial.

Recommended Posts

I am seeing this sort of code alot in the enginuity tutorial and i havent seen in the C++ book im reading. Can someone help me on what it means? static std::list liveObjects; I copied it fromt he Memory Managemnt section of the tutorial. regards, ACE

Share this post


Link to post
Share on other sites
its a static variable of type std::list from the std namespace. if its in a class then it will have the same value or list of objects for every copy of that class.

Share this post


Link to post
Share on other sites
Yes, and the standard library has a bunch of other containers as well, like vector (dynamic array), queue, stack, etc. All of which are also templates, so can be used to hold whatever type you want.

Share this post


Link to post
Share on other sites