Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
Union-Struct-uint32_t byte order
K combinator - Lazy evaluation
enum operator
pack expansion
Magic, why 1 2?
why
Assertion Divide by Zero Example
10226
non-deduced context
Derivation of the 0x9E3779B97F4A7C17u constant
Please log in to post a comment.