A pointer can itself be treated as an iterator in almost every way. The only problem that comes to mind would be if you expect to be calling .begin() and .end() on them.
How about...
Code:
#include <complex>
class wrapper {
std::complex<double> *a;
size_t n;
public:
wrapper(double *a, size_t n) :
a(reinterpret_cast< std::complex<double>* >(a)),
n(n * sizeof(double) / sizeof(std::complex<double>))
{}
const std::complex<double> *begin() const { return a; }
const std::complex<double> *end() const { return &a[n]; }
std::complex<double> *begin() { return a; }
std::complex<double> *end() { return &a[n]; }
};
int main()
{ double foo[6] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
wrapper w(&foo[0], sizeof(foo)/sizeof(foo[0]));
for (std::complex<double> *it = w.begin(); it != w.end(); ++it)
{
std::cout << *it << std::endl;
}
}
If you've seen any of the recent presentations about the new C++ standard, you may have seen that the non-member version of begin and end are now also the preferred thing to use if you have a new enough compiler.