File: nodes.cpp

package info (click to toggle)
terraphast 0.0%2Bgit20200413.8af2e4c%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 792 kB
  • sloc: cpp: 5,923; sh: 83; ansic: 55; makefile: 25
file content (25 lines) | stat: -rw-r--r-- 394 bytes parent folder | download | duplicates (3)
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
#include <terraces/trees.hpp>

#include <ostream>

namespace terraces {

std::ostream& operator<<(std::ostream& s, const node& n) {
	auto print_index = [&s](index_t i) {
		if (i == none) {
			s << "none";
		} else {
			s << i;
		}
	};
	s << '(';
	print_index(n.data[0]);
	s << ", ";
	print_index(n.data[1]);
	s << ", ";
	print_index(n.data[2]);
	s << ')';
	return s;
}

} // namespace terraces