Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sfinae
#include <iostream> #include <type_traits> template<typename T, typename V = bool> struct gpuConsumer : std::false_type {}; template<typename T> struct gpuConsumer<T, typename std::enable_if< std::is_same<typename T::gpu_type, T>::value // bool: gpu tipus-e , bool>::type> : std::true_type {}; struct X { using gpu_type = X; }; struct Y { int gpu_type = 1; }; struct Z { using gpu_type = int; }; struct A { }; int main() { std::cout << gpuConsumer<X>::value; std::cout << gpuConsumer<Y>::value; std::cout << gpuConsumer<Z>::value; std::cout << gpuConsumer<A>::value; }
run
|
edit
|
history
|
help
0
Clang-IsBaseOf
boost tokenizer
Fundamentos de programación. Tema 7. Ejercicio 6.
Palindrome Recursive Function Example
vector destruction - clang
11/29
Variable declarations in while loop conditions are also C++-only.
Linear search
Pure virtual function called!
Narrowing error