|
Boost : |
Subject: Re: [boost] Heterogeneous Container Library (HCL) Feedback and Testing
From: James Armstrong (armstrhu_at_[hidden])
Date: 2015-06-03 18:20:01
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk