Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
template specialization inheritance problem
//clang 3.8.0 #include <iostream> using namespace std; struct A { A() {} }; struct B : public A { B() {} }; template <typename T> struct X{ X(T& t) { cout << "X\n"; } }; template <> struct X<A> { X(A& a) { cout << "XA\n"; } }; int main() { cout << boolalpha; cout << is_base_of<A, A>::value << endl; cout << is_base_of<A, B>::value << endl; A a; B b; A& ra = b; X<A> xa(a); X<B> xb(b); X<A> xra(ra); }
run
|
edit
|
history
|
help
0
Graphs Iteration2 Directed Graphs
Class operator overloading the subscript and boundary check for array
Rounding float to nearest 1000 (fixed)
Merge Sort
ECE2574_Function_Calling_Example
Diamond example
11/18
test string
Linear search
Throttle Example using a circular queue (Push all but 2 less than maxSize; then pop all but 2 of current size)