Could you please suggest how to make it work. I really appreciate.
=============== =============== ============
The error messages generated by gcc 3.4.4:
Interfaces.h:38 : error: expected `,' or `...' before '&' token
Interfaces.h:38 : error: ISO C++ forbids declaration of `Position' with no type
Interfaces.h:39 : error: expected `,' or `...' before '&' token
Interfaces.h:39 : error: ISO C++ forbids declaration of `Position' with no type
=============== =============== ============
Expand|Select|Wrap|Line Numbers
- //interfaces.h
- #ifndef INTERFACES_H_
- #define INTERFACES_H_
- #include "RuntimeException.h"
- template <typename Object>
- class InspectableContainer {
- public:
- virtual int size() const = 0;
- virtual bool isEmpty() const = 0;
- class ObjectIterator;
- virtual ObjectIterator elements() const;
- class EmptyContainerException : public RuntimeException {
- public:
- EmptyContainerException(const string& err) : EmptyContainerException(err) {}
- };
- class BoundaryViolationException : public RuntimeException {
- public:
- BoundaryViolationException(const string& err) : RuntimeException(err) {}
- };
- };
- template <typename Object>
- class InspectablePositionalContainer
- : public InspectableContainer<Object> {
- public:
- class Position; // node position type
- class PositionIterator; // position iterator
- virtual PositionIterator positions() const; // get position iterator
- class InvalidPositionException : public RuntimeException {
- public:
- InvalidPositionException(const string& err) : RuntimeException(err) {}
- };
- };
- template <typename Object>
- class PositionalContainer
- : public InspectablePositionalContainer<Object> {
- public:
- virtual void swapElements(const Position& v, const Position& w) = 0; //ERROR OCCURS HERE!!!!!!!!!!!!
- virtual Object& replaceElement(const Position& v, const Object& e) = 0; //ERROR OCCURS HERE!!!!!!!!!!!!
- };
- #endif