Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
MSVC-IsBaseOf
#include <type_traits> #include <cstdint> struct A { }; struct B : A { }; template <typename T, typename U> struct IsBaseOf { constexpr static bool Testment(T* t) { return true; } constexpr static bool Testment(...) { return false; } constexpr static bool value = IsBaseOf<T,U>::Testment(static_cast<U*>(nullptr)); }; constexpr bool IsBaseOf<A, B>::value; // necessary definition in c++14 while redundant declaration since 1z int main() { static_assert(IsBaseOf<A, B>::value, "Pass"); }
run
|
edit
|
history
|
help
0
#21
boost::asyc fail with error C2280: attempting to reference a deleted function
For NULL-embedded strings, CStringT::Find() produces what you may not expect
hangman
throwing Copyable versus throwing MoveOnly
VC++ error C2440 with combined use of non-type template parameters
MSVC_example_GetAllocLength
du
Project
#32