OGLplus  (0.59.0) a C++ wrapper for rendering APIs

io.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_VALID_IF_IO_HPP
10 #define EAGINE_VALID_IF_IO_HPP
11 
12 #include "base.hpp"
13 #include <iosfwd>
14 
15 namespace eagine {
16 
19 template <typename T, typename P, typename L>
20 auto operator<<(std::ostream& out, const basic_valid_if<T, P, L>& v) -> auto& {
21  if(v.is_valid()) {
22  return out << v.value_anyway();
23  }
24  return out << "∅";
25 }
26 
27 } // namespace eagine
28 
29 #endif // EAGINE_VALID_IF_IO_HPP
Common code is placed in this namespace.
Definition: eagine.hpp:21
static auto operator<<(std::ostream &out, const identifier_name< M > &n) -> std::ostream &
Operator for writing identifier_name into output streams.
Definition: identifier.hpp:159
Basic template for conditionally-valid values.
Definition: base.hpp:86

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).