What is the difference between abstract class and pure abstract class in C++?

Milad Khajavi picture Milad Khajavi · Mar 6, 2013 · Viewed 14.6k times · Source

Example:

Iterators are pure abstractions: Anything that behaves like an iterator is an iterator.

What does it mean?

Answer

NPE picture NPE · Mar 6, 2013

An abstract class has at least one pure virtual function. This is standard C++ terminology.

Some people use the term pure abstract class to describe a class that has nothing but pure virtual functions (in other words, no data members and no concrete functions). This is equivalent to Java interfaces.

Now to your actual question:

Iterators are pure abstractions: Anything that behaves like an iterator is an iterator.

This has nothing to do with abstract classes (pure or otherwise). All it's saying is that anything that fulfils the iterator contract is an iterator. It doesn't even have to be a class (think pointers).