VCTR
Loading...
Searching...
No Matches
StdOstreamOperator.h
1/*
2 ==============================================================================
3 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
5 Copyright 2022- by sonible GmbH.
6
7 This file is part of VCTR - Versatile Container Templates Reconceptualized.
8
9 VCTR is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License version 3
11 only, as published by the Free Software Foundation.
12
13 VCTR 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. See the
16 GNU Lesser General Public License version 3 for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 version 3 along with VCTR. If not, see <https://www.gnu.org/licenses/>.
20 ==============================================================================
21*/
22
23namespace vctr
24{
25
26template <is::anyVctrOrExpression V>
27std::ostream& operator<< (std::ostream& s, const V& vec)
28{
29 s << "[ ";
30
31 const auto n = vec.size() - 1;
32
33 size_t i = 0;
34 for (; i < n; ++i)
35 s << vec[i] << ", ";
36
37 s << vec[i] << " ]";
38
39 return s;
40}
41
42} // namespace vctr
The main namespace of the VCTR project.
Definition: Array.h:24