mirror of
https://github.com/Icinga/icinga2.git
synced 2026-02-03 20:40:17 -05:00
InitializeOnceHelper calls Loader::AddDeferredInitializer which takes a std::function, so it's eventually converted to that anyways. This commit just does this a bit earlier, and by saving the step of the intermediate C function pointer, this would now also work for capturing lambdas (which there are none of at the moment).
13 lines
283 B
C++
13 lines
283 B
C++
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
|
|
|
#include "base/initialize.hpp"
|
|
#include "base/loader.hpp"
|
|
|
|
using namespace icinga;
|
|
|
|
bool icinga::InitializeOnceHelper(const std::function<void()>& func, int priority)
|
|
{
|
|
Loader::AddDeferredInitializer(func, priority);
|
|
return true;
|
|
}
|
|
|