List.hpp: Fix code style

This commit is contained in:
Lorenz Meier 2015-09-06 12:02:43 +02:00
parent e809571841
commit fc745a7afc
1 changed files with 12 additions and 8 deletions

View File

@ -43,31 +43,35 @@ template<class T>
class __EXPORT ListNode
{
public:
ListNode() : _sibling(nullptr) {
ListNode() : _sibling(nullptr)
{
}
virtual ~ListNode() {};
void setSibling(T sibling) { _sibling = sibling; }
T getSibling() { return _sibling; }
T get() {
T get()
{
return _sibling;
}
protected:
T _sibling;
private:
// forbid copy
ListNode(const ListNode& other);
ListNode(const ListNode &other);
// forbid assignment
ListNode & operator = (const ListNode &);
ListNode &operator = (const ListNode &);
};
template<class T>
class __EXPORT List
{
public:
List() : _head() {
List() : _head()
{
}
virtual ~List() {};
void add(T newNode) {
void add(T newNode)
{
newNode->setSibling(getHead());
setHead(newNode);
}
@ -77,7 +81,7 @@ protected:
T _head;
private:
// forbid copy
List(const List& other);
List(const List &other);
// forbid assignment
List& operator = (const List &);
List &operator = (const List &);
};