Tulip 5.7.1
Large graphs analysis and drawing
Loading...
Searching...
No Matches
Array.h
1/*
2 *
3 * This file is part of Tulip (https://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
25namespace tlp {
26
27template <typename T, size_t N>
28using 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 */
36template <typename T, size_t N>
37std::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 */
45template <typename T, size_t N>
46std::istream &operator>>(std::istream &is, Array<T, N> &array);
47} // namespace tlp
48
49#include "cxx/Array.cxx"
50
51#endif // TLP_ARRAY_H
std::ostream & operator<<(std::ostream &os, const Array< T, N > &array)
operator << stream operator to easily print an array, or save it to a file.
std::istream & operator>>(std::istream &is, Array< T, N > &array)
operator >> stream operator to easily read an array