Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "List.h"
- class CppList {
- List* _list_ptr;
- public:
- /*
- * Creates an empty CppList.
- */
- CppList()
- : _list_ptr(List_alloc()) {
- }
- ~CppList() {
- List_free(_list_ptr);
- }
- CppList(const CppList& other) :
- _list_ptr(List_clone(other._list_ptr)) {
- }
- CppList& operator=(const CppList& other) {
- if (this!=&other) {
- List_free(_list_ptr);
- _list_ptr= List_clone(other._list_ptr);
- }
- return *this;
- }
- void insertFirst(double data) {
- List_insertFirst(_list_ptr, data);
- }
- double firstData() const {
- return List_firstData(_list_ptr);
- }
- // TODO: make it a global
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement