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 <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
MY FIRST OBJECT ORIENTED PROGRAM
hello,world !ssn2019
Composite pattern
MPL 2-1
What's the problem with this?
7
First test
Graphs Iteration 2.1 Directed Graphs
11/18
Fun with Pointers #1