mirror of
https://github.com/Jaxan/hybrid-ads.git
synced 2025-04-27 23:17:44 +02:00
10 lines
216 B
C++
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);
|
|
}
|