PlasmaActivitiesStats

debug_and_return.h
1/*
2 SPDX-FileCopyrightText: 2015 Ivan Cukic <ivan.cukic(at)kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#ifndef DEBUG_AND_RETURN_H
8#define DEBUG_AND_RETURN_H
9
10#ifdef QT_DEBUG
11#include <QDebug>
12#endif
13
14namespace kamd
15{
16namespace utils
17{
18template<typename T>
19T debug_and_return(bool debug, const char *message, T &&value)
20{
21 if (debug) {
22 qDebug().noquote() << message << " " << value;
23 }
24
25 return std::forward<T>(value);
26}
27
28} // namespace utils
29} // namespace kamd
30
31#endif // DEBUG_AND_RETURN_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 28 2025 12:01:02 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.