List.hpp: Fix code style

This commit is contained in:
Lorenz Meier
2015-09-06 12:02:43 +02:00
parent e809571841
commit fc745a7afc
+12 -8
View File
@@ -43,31 +43,35 @@ template<class T>
class __EXPORT ListNode class __EXPORT ListNode
{ {
public: public:
ListNode() : _sibling(nullptr) { ListNode() : _sibling(nullptr)
{
} }
virtual ~ListNode() {}; virtual ~ListNode() {};
void setSibling(T sibling) { _sibling = sibling; } void setSibling(T sibling) { _sibling = sibling; }
T getSibling() { return _sibling; } T getSibling() { return _sibling; }
T get() { T get()
{
return _sibling; return _sibling;
} }
protected: protected:
T _sibling; T _sibling;
private: private:
// forbid copy // forbid copy
ListNode(const ListNode& other); ListNode(const ListNode &other);
// forbid assignment // forbid assignment
ListNode & operator = (const ListNode &); ListNode &operator = (const ListNode &);
}; };
template<class T> template<class T>
class __EXPORT List class __EXPORT List
{ {
public: public:
List() : _head() { List() : _head()
{
} }
virtual ~List() {}; virtual ~List() {};
void add(T newNode) { void add(T newNode)
{
newNode->setSibling(getHead()); newNode->setSibling(getHead());
setHead(newNode); setHead(newNode);
} }
@@ -77,7 +81,7 @@ protected:
T _head; T _head;
private: private:
// forbid copy // forbid copy
List(const List& other); List(const List &other);
// forbid assignment // forbid assignment
List& operator = (const List &); List &operator = (const List &);
}; };