Run Code
|
API
|
Code Wall
|
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
Use std::is_base_of to subset STL container contents.
hangman
Overload
#18
namespace name resolution
Data structure alignment
hangman
hangman
MSVC noexcept - works
Problem_rstring_1