JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
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
13namespace jngl {
14
15template <class T>
16#ifdef NDEBUG
17void debug(const T&) {
18#else
19void debug(const T& t) {
21 s << t;
22 printMessage(s.str());
23#endif
24}
25
26template <class T>
27#ifdef NDEBUG
28void debugLn(const T&) {
29#else
30void 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: Achievement.hpp:10
void printMessage(const std::string &text)
Prints text on stdout.
T str(T... args)