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
Member inheritance
Union-Struct-uint32_t byte order
Result of not joining thread in main()
Reference example
BucketSort
hw1 Os
Variable declarations in while loop conditions are also C++-only.
Virtual Function Example
Last Class Quiz - Working with Hash Table
10 naturalnumbers