1
Fork 0
mirror of https://github.com/Jaxan/hybrid-ads.git synced 2025-04-27 23:17:44 +02:00
hybrid-ads/lib/logging.hpp
2015-03-19 17:25:33 +01:00

10 lines
216 B
C++

#pragma once
#include <mutex>
// Works particularly nice with lambda's, as they give naturally unique types :)
template <typename F>
void fire_once(F && f){
static std::once_flag flag;
std::call_once(flag, f);
}