Size: 510 bytes.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// cs/q/trees/node.hh
#ifndef CS_Q_TREES_NODE_HH
#define CS_Q_TREES_NODE_HH

#include <utility>

namespace cs::q::trees {

template <typename T>
struct Node {
  T value;
  Node<T>* left;
  Node<T>* right;

  template <typename U>
  explicit Node(U&& val)
      : value(std::forward<U>(val)),
        left(nullptr),
        right(nullptr) {}
  explicit Node(T value, Node<T>* left, Node<T>* right)
      : value(value), left(left), right(right) {}
};
}  // namespace cs::q::trees

#endif  // CS_Q_TREES_NODE_HH
v0 (commit) © 2025 @p13i.io | Load balancer proxied to: cs-code-viewer-2:8080 in 4ms.