Implemented a C++ iterator for iterating over the flattened view of a ndarray using boost::iterator_facade.