JNGL
debug.hpp
Go to the documentation of this file.
1 // Copyright 2012-2021 Jan Niklas Hasse <[email protected]>
2 // For conditions of distribution and use, see copyright notice in LICENSE.txt
5 #pragma once
6 
7 #ifndef NDEBUG
8 #include "message.hpp"
9 
10 #include <sstream>
11 #endif
12 
13 namespace jngl {
14 
15 template <class T>
16 #ifdef NDEBUG
17 void debug(const T&) {
18 #else
19 void debug(const T& t) {
21  s << t;
22  printMessage(s.str());
23 #endif
24 }
25 
26 template <class T>
27 #ifdef NDEBUG
28 void debugLn(const T&) {
29 #else
30 void debugLn(const T& t) {
32  s << t << std::endl;
33  printMessage(s.str());
34 #endif
35 }
36 
37 } // namespace jngl
T endl(T... args)
JNGL's main namespace.
Definition: App.hpp:10
void printMessage(const std::string &text)
Prints text on stdout.
T str(T... args)