I was expecting the second assert in the following to pass. I'm asking for your help.
Edit: It didn't work when I had poss everywhere instead of poss_a in some places.
#include <vector>
#include <cassert>
class Sampler
{
public:
std::vector<int*> poss;
std::vector<int*>::const_iterator poss_it;
Sampler(std::vector<int*> poss_a) : poss(poss_a), poss_it(poss.begin())
{
assert( (poss[0]) == (*poss_it) ); //passes
}
};
int main()
{
int someInt;
std::vector<int*> poss_a(1, &someInt);
Sampler sampler(poss_a);
assert( ((sampler.poss)[0]) == (*(sampler.poss_it)) ); //passes now
return 0;
}