Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef LIST_H
- #define LIST_H
- #include <initializer_list>
- #include <memory>
- class List
- {
- public:
- List();
- // List(List const &);//kopieringskonstruktor
- // List(List &&) noexcept;//flyttkonstruktor
- List(std::initializer_list<int>);
- // List & operator=(List const &)&;
- // List & operator=(List &&)& noexcept;
- // void push_front(int);
- void push_back(int);
- int back() const noexcept;
- int & back() noexcept;
- int front() const noexcept;
- int & front() noexcept;
- int & at(int idx);
- int const & at(int idx) const;
- int size() const noexcept;
- // bool empty() const noexcept;
- // void swap(List & other) noexcept;
- private:
- struct Node;
- Node* head {};
- Node* tail {};
- int sz {};
- };
- #endif //LIST_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement