-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make AppClass::transport_generator initialized at const-init time (#3665
) This fixes the "bad_function_call" issue where it was invoked while null (probably actually uninitialized). I'm not sure why it wasn't initialized yet, since the compiler should have ensured that it was. There is likely a compiler bug there but I'll need to dig in more. To work around that, I made it a simple function pointer, which lambdas can implicitly convert to, and all of that should be possible at const-init time (basically, it should be burned into the binary image with nothing happening at runtime). Unfortunately due to a different compiler bug, (https://developercommunity.visualstudio.com/t/const-init-of-function-pointers-from-lambdas/1383098), this requires putting a `+` in front of the lambda to explicitly decay it to a function pointer, rather than relying on the implicit conversion.
- Loading branch information
1 parent
f3b7c9f
commit b8ce8c3
Showing
3 changed files
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters