Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C++ Template
//clang 3.8.0 #include <iostream> using namespace std; template<typename T> class Container { private: T elt; public: Container(const T arg) : elt(arg) {} T inc() {return elt+1;} }; template <> class Container<char> { private: char elt; public: Container(const char arg) : elt(arg) {} char uppercase() {return toupper(elt);} }; int main() { Container<int> icont(5); Container<char> ccont('r'); cout << icont.inc() <<endl; cout << ccont.uppercase() <<endl; return 0; }
run
|
edit
|
history
|
help
0
why
What's the problem with this?
Throttle Example in C++
Wrapper to pass shared_ptr to &, const &, *, const * through std::bind.
Throttle Example using circular queue (push all but 2 less than maxSize; then pop all but 2 less than current size)
A
std::function ambiguity clang
C++ standard
Linear search
set/map equal_range bug in libc++