Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
template specialization inheritance problem
//clang 3.8.0 #include <iostream> using namespace std; struct A { A() {} }; struct B : public A { B() {} }; template <class T> void f(const T& t) { cout << "f\n"; } template <> void f<A>(const A& a) { cout << "fA\n"; } int main() { A a; B b; A& ra = b; f(a); f(b); // Not fA!!! f(ra); }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
FUCK
Dat pointers
Alternation regex
bank queue
Peregruzka
Palindrome Recursive Function Example
Vector of pointer of P...
back_inserter example
Random values and probability distribution
nontype template parameter produced with decltype for function
stackse - search stackoverflow differently
Please log in to post a comment.