Created
January 29, 2019 20:42
-
-
Save trzecieu/8ebe6a15a3a3759e7701888a3581cd62 to your computer and use it in GitHub Desktop.
nullptr vtable vs2017
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
#include <functional> | |
struct Base { | |
virtual void f() const = 0; | |
}; | |
int main() { | |
struct : public Base { | |
void f() const override {} | |
} a, b; // vTables of 'a' and 'b' contain nulls | |
// not crucial for problem, helps to emphasize problem | |
std::invoke(&Base::f, a); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment