In experimenting with the new BOOST_FOREACH header, I'm getting the compile error (MSVC 7.1) below with this code. The documentation for BOOST_FOREACH says:
The support for STL containers is very general; anything that looks like an STL container counts. If it has nested iterator and const_iterator types and begin() and end() member functions, BOOST_FOREACH will automatically know how to iterate over it.
I've checked, and the hashed_array_tree class does have nested iterator and
const_iterator types, as well as begin() and end() member functions. (It's
originally from www.cphstl.dk, but that site no longer provides the code.)
Replacing hashed_array_tree with vector gets rid of the error, so there's
obviously something I need to fix in the hashed_array_tree. How do I figure
out what that is, though?
Any help will be greatly appreciated.
===code===
#include <memory>
#include <iostream>
#include "foreach.hpp"
#include "math_utils.hpp"
#include "hashed_array_tree.hpp"
#include "hat_iterator.hpp"
using namespace std;
using namespace boost;
using namespace cphstl;
class A {
public:
int foo;
};
void test() {
const hashed_array_tree