Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
compile-time check of existness of method of a class
//g++ 4.9.3 #include <iostream> using yes_meta_t = char; using no_meta_t = char[2]; template <typename T> yes_meta_t& func(T const& obj, decltype(&T::method) = &T::method); template <typename T> no_meta_t& func(...); class X { public: void method(int, int) { } }; int main() { std::cout << std::boolalpha; std::cout << (sizeof(func<X>(std::declval<X>())) == sizeof(yes_meta_t)) << std::endl; }
run
|
edit
|
history
|
help
0
Continuous Sub Set with given sum
InviteList
override
test
lab17feb22x4B.cpp
Date n Time Macros
Matrix rotation
lock
Dij. Algo
maximize the difference