![]() |
【转帖】odstack class functionality
odstack class functionality
odstack class functionality i have created an odgematrix3d stack that is populated in various functions. but there seems to be some missing functionality compared with std::stack. how can i discover the size of the stack, and how do i empty it. ? regards gerry actually i mean how do i check if the stack is empty. check if top() is zero? vladimir yes it's fine to check if top () is null to see if the stack is empty, but how can i find the size or depth of the stack ? regards gerry the class is rather simple. perhaps it should have been called odsimplestack. for more powerful interface use std::stack<> vladimir thanks vladimir. i am using this for a odgematrix3d stack which takes a bit more effort to use as std:stack (). so as a minor request can you add the size () and empty () methods when or if you revise this class again. i'll add these methods, no problem, but what are the problems with std::stack and odgematrix3d ? vladimir there aren't any real problems using std:stack vladimir. it's just that i have been using yours, and now need to know the stack depth. regards gerry |
所有的时间均为北京时间。 现在的时间是 03:16 AM. |