Moved all function definitions into header files as required for templated classes/functions
This commit is contained in:
@ -1,6 +0,0 @@
|
||||
#include "linkedlist.h"
|
||||
#include "linkedlistnode.h"
|
||||
|
||||
namespace Datastructures {
|
||||
|
||||
}
|
@ -1,4 +1,6 @@
|
||||
#pragma once
|
||||
#include "linkedlistnode.h"
|
||||
|
||||
namespace Datastructures {
|
||||
template <typename T>
|
||||
class LinkedList
|
||||
|
@ -1,17 +0,0 @@
|
||||
#include "linkedlistnode.h"
|
||||
|
||||
namespace Datastructures {
|
||||
namespace Nodes {
|
||||
template <typename T>
|
||||
LinkedListNode<T>::LinkedListNode(T value, std::shared_ptr<LinkedListNode<T>> next) {
|
||||
this->value = value;
|
||||
this->next = next;
|
||||
}
|
||||
|
||||
//Creates a new node, returning a smart pointer to a stack allocated object
|
||||
template <typename T>
|
||||
std::shared_ptr<LinkedListNode<T>> LinkedListNode<T>::create(T value, std::shared_ptr<LinkedListNode<T>> next) {
|
||||
return std::make_shared<LinkedListNode<T>>(value, next);
|
||||
}
|
||||
}
|
||||
}
|
@ -15,5 +15,17 @@ namespace Datastructures {
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
LinkedListNode<T>::LinkedListNode(T value, std::shared_ptr<LinkedListNode<T>> next) {
|
||||
this->value = value;
|
||||
this->next = next;
|
||||
}
|
||||
|
||||
//Creates a new node, returning a smart pointer to a stack allocated object
|
||||
template <typename T>
|
||||
std::shared_ptr<LinkedListNode<T>> LinkedListNode<T>::create(T value, std::shared_ptr<LinkedListNode<T>> next) {
|
||||
return std::make_shared<LinkedListNode<T>>(value, next);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user