Support app constructor arguments in app::main
This commit is contained in:
parent
6ec10e9463
commit
91de56753b
1 changed files with 5 additions and 3 deletions
|
|
@ -2,15 +2,17 @@
|
||||||
|
|
||||||
#include <psemek/log/log.hpp>
|
#include <psemek/log/log.hpp>
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
namespace psemek::app
|
namespace psemek::app
|
||||||
{
|
{
|
||||||
|
|
||||||
template <typename App>
|
template <typename App, typename ... Args>
|
||||||
int main() try
|
int main(Args && ... args) try
|
||||||
{
|
{
|
||||||
log::register_thread("main");
|
log::register_thread("main");
|
||||||
|
|
||||||
App app;
|
App app(std::forward<Args>(args)...);
|
||||||
|
|
||||||
log::info() << "Running";
|
log::info() << "Running";
|
||||||
app.run();
|
app.run();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue