Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
stream_enum.hpp
1//This file is part of Bertini 2.
2//
3//bertini2/common/stream_enum.hpp is free software: you can redistribute it and/or modify
4//it under the terms of the GNU General Public License as published by
5//the Free Software Foundation, either version 3 of the License, or
6//(at your option) any later version.
7//
8//bertini2/common/stream_enum.hpp is distributed in the hope that it will be useful,
9//but WITHOUT ANY WARRANTY; without even the implied warranty of
10//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11//GNU General Public License for more details.
12//
13//You should have received a copy of the GNU General Public License
14//along with tracking/include/bertini2/trackers/config.hpp. If not, see <http://www.gnu.org/licenses/>.
15//
16// Copyright(C) 2015 - 2021 by Bertini2 Development Team
17//
18// See <http://www.gnu.org/licenses/> for a copy of the license,
19// as well as COPYING. Bertini2 is provided with permitted
20// additional terms in the b2/licenses/ directory.
21
22
23// individual authors of this file include:
24// silviana amethyst, university of notre dame, university of wisconsin eau claire
25// Tim Hodges, Colorado State University
26
27#ifndef BERTINI2_STREAM_ENUM
28#define BERTINI2_STREAM_ENUM
29
30#pragma once
31
32
33namespace bertini
34{
35
48 template<typename T>
49 std::ostream& operator<<(typename std::enable_if<std::is_enum<T>::value, std::ostream>::type& stream, const T& e)
50 {
51 return stream << static_cast<typename std::underlying_type<T>::type>(e);
52 }
53
54} // namespace bertini
55
56
57
58
59#endif // include guard
60