v1
parent
8b6f2978f5
commit
a772fb42d5
|
@ -31,13 +31,10 @@ namespace BLT {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void insert(const T& t) {
|
void insert(const T& t) {
|
||||||
auto newNode = new node<T>(t, nullptr);
|
|
||||||
if (head == nullptr)
|
if (head == nullptr)
|
||||||
head = newNode;
|
head = new node<T>(t, nullptr);
|
||||||
else {
|
else
|
||||||
newNode->next = head;
|
head = new node<T>(t, head);
|
||||||
head = newNode;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] const T& front() const {
|
[[nodiscard]] const T& front() const {
|
||||||
|
|
Loading…
Reference in New Issue