#pragma once
class iterator
{
public:
typedef std::forward_iterator_tag iterator_category;
typedef T value_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef T& reference;
iterator();
// Get the data element at this position
reference operator*() const;
pointer operator->() const;
// Move position forward 1 place
iterator& operator++();
iterator operator++(int);
// Comparison operators
bool operator== (const iterator&) const;
bool operator!= (const iterator&) const;
private:
};
I get the compile error complaining about line 6:
error C2146: syntax error : missing ';' before identifier 'value_type'Is there an #include I need to add to make this work?
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE