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 <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.
C++17 function traits not works
vector flavors....
2574 EC
regimeketopdfb
List comprehension in C++ using functional patterns
Own initialization
template specialization inheritance solution
Alloc
Palindrome Recursive Function Example
Copy uint64 data into uint32 with padding
Please log in to post a comment.