So what I want to do is to create a template class which may or may not contain a member variable based on the template argument passed in. like following:
t
#pragma once
#include
template
class Node;
template
class Node>
{
public:
Node(const T& v) : value(v) {}
private:
T value;
Node* next = nullptr;
};
template
class Node>
{
public:
Node(const T& v) : value(v) {}
private:
T value;
Node* next = nullptr;
Node* prev = nullptr;
};
Single or double linked list node based on boolean flag