Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
dynamic_cast in assert Causing Error
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86 #include <cassert> #include <iostream> #include <utility> using namespace std; struct base { virtual ~base() {} }; template <typename T> struct Foo : base { T foo; }; int main() { base* test = new Foo<pair<int, int>>; assert(dynamic_cast<Foo<pair<int, int>>*>(test) != NULL); if(dynamic_cast<Foo<pair<int, int>>*>(test) != NULL) cout << "hello world\n"; //assert(Foo<pair<int, int>>*) != NULL); }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
CIS-2207 Week1 Assignment1 Company Devisions
Arrays
assaa
My Window
sharedptr emptiness
Union and possible undefined behavior
Guess a number in c++
MSVC noexcept - works
Static cast of Enum
Data structure alignment
Please log in to post a comment.