|
-
April 28th, 2017, 08:14 AM
#1
Container agnostic view for data
Hello,
I'd like to create container agnostic view for data, so that I can iterate over all or somehow filtered items. I'd like to be container agnostic, because I use sometimes std::vector, std::list, etc.
Example:
Code:
std::vector<CustomClass> dataVec;
std::list<CustomClass> dataList;
View<CustomClass> viewForVec(dataVec);
View<CustomClass> viewForList(dataList);
for(auto & data: viewForVec) {
doSth();
}
Now, I have no idea how to get it done. Maybe anyone of you could give me some hints about it.
Tags for this Thread
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
|