Action requires a user-defined constructor accepting those parameters for the brace initialization to compile. MSVC probably allows this behavior, but GCC will throw errors.
error: no matching function for call to ‘osgEarth::Util::EventRouter::Action<std::function<void()> >::Action(<brace-enclosed initializer list>)’
225 | _keypress_simple[key].emplace_back(Action<Function>{ func, eat });
| ^
Describe the bug The following only applies when compiling with the C++11 standard. The requirements causing this error were relaxed in C++14.
The
osgEarth::Util::EventRouter::Action
struct has members which use in-class initialization.Because of this, it isn't an aggregate and can't be used with struct initialization as it is in the various
EventRouter
functions: https://github.com/gwaldron/osgearth/blob/7b8926bfcce486d1d77f0288e206637dd45e22bc/src/osgEarth/ExampleResources#L225Action
requires a user-defined constructor accepting those parameters for the brace initialization to compile. MSVC probably allows this behavior, but GCC will throw errors.