Currently, to use std::for_each with bz_APIIntList, code has to be written like this...
(Note that operator[] has to be used because it is the only function that returns a reference to const, and the dataBlob member is protected.)
Code: Select all
bz_APIIntList *player_list = bz_newIntList();
bz_getPlayerIndexList(player_list);
std::for_each(&(*player_list)[0],
&(*player_list)[player_list->size()],
std::bind2nd(kill_team_player(), team));
Code: Select all
std::for_each(&player_list->operator[](0),
&player_list->operator[](player_list->size()),
std::bind2nd(kill_team_player(), team));
Code: Select all
std::for_each(player_list->begin(),
player_list->end(),
std::bind2nd(kill_team_player(), team));
Code: Select all
class bzAPIIntList {
typedef std::vector<int>::iterator iterator;
...
};
bzAPIIntList::iterator begin = blah.begin();
Anyway, I hope I did not overlook anything, and thanks for taking the time to read this.