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