It would be easy to make such a class. Something like this:
template <class T>
class array_ref {
public:
// makes it work with iterator traits..
typedef T value_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef T* iterator;
typedef T& reference;
typedef const T* const_pointer;
typedef const T* const_iterator;
typedef const T& const_reference;
public:
array_ref(T *p, size_t n) : data_(p), len_(n) {}
// iteration
iterator begin() { return data_; }
iterator end() { return data_ + len_; }
const_iterator begin() const { return data_; }
const_iterator end() const { return data_ + len_; }
// access
reference operator[](size_t n) { return data_[n]; }
reference at(size_t n) { return data_[n]; }
const_reference operator[](size_t n) const { return data_[n]; }
const_reference at(size_t n) const { return data_[n]; }
// capacity
size_t size() const { return len_; }
bool empty() const { return size() == 0; }
// raw access
T* data() const { return data_; }
// etc...
private:
T* data_;
size_t len_;
};
This looks like a bunch of code, most of it isn't strictly necessary. However, since it is a template the compiler will only generate code for the methods used. And the actual class itself only uses space for the pointer and the length members.
But in the end, this really isn't much of a gain. Since pointers themselves are nice pointers, I'd probably just use raw pointers here.