array_impl.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 
5 template<typename elt_t>
6 class ArrayAsTree {
7 
8  typedef elt_t elt_type;
9 
10 
11  elt_type& parent(int index);
12  elt_type& left(int index);
13  elt_type& right(int index);
14 
15  elt_type& root;
16 
17 
18  private:
19  vector<int> storage;
20 };
21 
22 
23 /*
24 
25 
26 Example:
27 
28  TreeAsArray<int> T;
29 
30 
31  T::left(T.root);
32 
33 
34  add a children -> T.chil
35 
36 
37  */
Definition: array_impl.h:6