
3 Jun
2015
3 Jun
'15
10:20 p.m.
eerrr...found a couple errors in that previous code. The database class should be class database { public: enum class OBJECT_TYPES { PAPER, NOTEPAD, FOLDER, TRASH, COOKIE, CANDY, STAPLER, COIN }; bool peek() { return index >= data.size() ? false : true; } OBJECT_TYPES type() { return types_[index]; } template<typename T> T* next() { return static_cast<T*>( data[index++] ); } private: std::vector<OBJECT_TYPES> types_; std::vector<void*> data; size_t index; }; won't guarantee the code will actually compile anywhere, but the gist of it is there. -- James Armstrong