DSA - Data Structures and Algorithms
Loading...
Searching...
No Matches
dsa::List< T >::Node Class Reference

Implements Node template class with pointer to adjacent elements. More...

#include <list.h>

Inheritance diagram for dsa::List< T >::Node:
dsa::List< T >::NodeBase

Public Member Functions

 Node (T value)
 Construct a new Node object with initial value.
auto value () -> T &
 Function returns value stored in Node object.
auto value () const -> T
 Function returns value stored in Node object.
Public Member Functions inherited from dsa::List< T >::NodeBase
 NodeBase ()=default
 Construct a new NodeBase object.
 NodeBase (const NodeBase &other)=default
 Construct a new NodeBase object using copy constructor.
auto operator= (const NodeBase &other) -> NodeBase &=default
 Construct a new NodeBase object using copy assignment.
 NodeBase (NodeBase &&other)=default
 Construct NodeBase object using move constructor.
auto operator= (NodeBase &&other) -> NodeBase &=default
 Construct NodeBase object using move assignment.
virtual ~NodeBase ()=default
 Destroy the Node Base object.

Friends

class List
 Forward friend declaration of List.

Detailed Description

template<typename T>
class dsa::List< T >::Node

Implements Node template class with pointer to adjacent elements.

Definition at line 127 of file list.h.

Constructor & Destructor Documentation

◆ Node()

template<typename T>
dsa::List< T >::Node::Node ( T value)
inline

Construct a new Node object with initial value.

Parameters
[in]valueto store in Node object

Definition at line 136 of file list.h.

137 : m_value{ value }
138 {
139 }
auto value() -> T &
Function returns value stored in Node object.
Definition list.h:146

Member Function Documentation

◆ value() [1/2]

template<typename T>
auto dsa::List< T >::Node::value ( ) -> T&
inline

Function returns value stored in Node object.

Returns
T value stored in Node

Definition at line 146 of file list.h.

147 {
148 return m_value;
149 }

◆ value() [2/2]

template<typename T>
auto dsa::List< T >::Node::value ( ) const -> T
inlinenodiscard

Function returns value stored in Node object.

Returns
T value stored in Node

Definition at line 156 of file list.h.

157 {
158 return m_value;
159 }

◆ List

template<typename T>
friend class List
friend

Forward friend declaration of List.

Definition at line 166 of file list.h.


The documentation for this class was generated from the following file: