Tulip  5.2.0
Large graphs analysis and drawing
Array.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 #ifndef TLP_ARRAY_H
20 #define TLP_ARRAY_H
21 
22 #include <array>
23 #include <iostream>
24 
25 namespace tlp {
26 
27 template <typename T, size_t N>
28 using Array = std::array<T, N>;
29 
30 /**
31  * @brief operator << stream operator to easily print an array, or save it to a file.
32  * @param os The stream to output to.
33  * @param array The array to output.
34  * @return The stream to output to, to chain calls.
35  */
36 template <typename T, size_t N>
37 std::ostream &operator<<(std::ostream &os, const Array<T, N> &array);
38 
39 /**
40  * @brief operator >> stream operator to easily read an array
41  * @param is The stream to read from.
42  * @param array A reference to an array, that will be written to.
43  * @return The stream to read from, to chain calls.
44  */
45 template <typename T, size_t N>
46 std::istream &operator>>(std::istream &is, Array<T, N> &array);
47 }
48 
49 #include "cxx/Array.cxx"
50 
51 #endif // TLP_ARRAY_H
std::istream & operator>>(std::istream &is, Array< T, N > &array)
operator >> stream operator to easily read an array