-
October 13th, 2013, 04:15 AM
#1
STL algorithm adapter
Hello,
An external library has the following header file;
Code:
template <typename T>
class MyCollection
{
public:
MyCollection();
const T& operator[](unsigned long index) const;
unsigned long length() const;
private:
std::vector<void*> v;
};
To iterate this collection I can obviously use a loop. However, would it be possible to use STL algorithms functions on this collection? A lot of those methods use an iterator as input parameter, would be possible to make an adapter class to make this work?
Before post, make an effort yourself, try googling or search here.
When posting, give a proper description of your problem, include code* and error messages.
*All code should include code tags
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|