mirror of
https://github.com/hyprwm/hyprutils.git
synced 2025-12-20 14:00:09 +01:00
Compare commits
No commits in common. "main" and "v0.11.0" have entirely different histories.
2 changed files with 1 additions and 5 deletions
|
|
@ -26,13 +26,10 @@ namespace Hyprutils {
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
class CSignalT : public CSignalBase {
|
class CSignalT : public CSignalBase {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using RefArg = std::conditional_t<std::is_trivially_copyable_v<T>, T, const T&>;
|
using RefArg = std::conditional_t<std::is_reference_v<T> || std::is_arithmetic_v<T>, T, const T&>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void emit(RefArg<Args>... args) {
|
void emit(RefArg<Args>... args) {
|
||||||
if (m_vListeners.empty() && m_vStaticListeners.empty())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if constexpr (sizeof...(Args) == 0)
|
if constexpr (sizeof...(Args) == 0)
|
||||||
emitInternal(nullptr);
|
emitInternal(nullptr);
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,6 @@ void CLoggerImpl::log(eLogLevel level, const std::string_view& msg, const std::s
|
||||||
if (m_stdoutEnabled) {
|
if (m_stdoutEnabled) {
|
||||||
try {
|
try {
|
||||||
std::println("{}{}", m_colorEnabled ? logPrefixColor : logPrefix, logMsg);
|
std::println("{}{}", m_colorEnabled ? logPrefixColor : logPrefix, logMsg);
|
||||||
std::fflush(stdout);
|
|
||||||
} catch (std::exception& e) {
|
} catch (std::exception& e) {
|
||||||
; // this could be e.g. stdout closed
|
; // this could be e.g. stdout closed
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue