Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
0 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
459fd5f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this could be solved in C++17 by using this-by-copy capture (
*this
- ortmp = *this
for C++14)?459fd5f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no this would do something very differnt, it would copy the mp_join_game object. The way labdas basicially works is is as a shortcut for normal function objects, meaning this code
is basicially equivalent to
changing it to 'this-by-copy' would be equivalent to changing the type of the memper varible of the functionstruct from
mp_join_game *
tomp_join_game
but acessing freed mamory is still ub no matter whether its of typemp_join_game *
ormp_join_game