image.png

    code:
    image.png

    1. #ifndef LIST_H
    2. #define LIST_H
    3. #include "object.h"
    4. namespace DJLib
    5. {
    6. template <typename T>
    7. class List: public object
    8. {
    9. virtual bool insert(int i, const T& e) = 0;
    10. virtual bool remove( int i) = 0;
    11. virtual bool set(int i, const T& e) = 0;
    12. virtual bool get(int i, T& e) const = 0;
    13. virtual int length() const = 0;
    14. virtual void clear() = 0;
    15. };
    16. }
    17. #endif // LIST_H

    image.png

    1. #include <iostream>
    2. #include "List.h"
    3. using namespace std;
    4. using namespace DJLib;
    5. int main()
    6. {
    7. List<int>* l = NULL;
    8. return 0;
    9. }