JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
jngl
debug.hpp
Go to the documentation of this file.
1
// Copyright 2012-2021 Jan Niklas Hasse <jhasse@gmail.com>
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) {
20
std::stringstream
s;
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) {
31
std::stringstream
s;
32
s << t <<
std::endl
;
33
printMessage
(s.
str
());
34
#endif
35
}
36
37
}
// namespace jngl
std::stringstream
std::endl
T endl(T... args)
message.hpp
jngl
JNGL's main namespace.
Definition
Achievement.hpp:10
jngl::printMessage
void printMessage(const std::string &text)
Prints text on stdout.
sstream
std::stringstream::str
T str(T... args)