Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Python Like C++ Overload Function Template
//g++ 7.4.0 /**************************** Python like print() multiple data type overload function template by: Robin Deatherage *****************************/ #include <iostream> #include <string.h> template <typename Transylvania> void print (Transylvania ghost) { std::cout << ghost; }; using namespace std; int main() { print("["); print("string");// char string print(", "); print(7.274); // float print(", "); print(198+2); // integer print(", "); print("67"); // char string number print("]"); }
run
|
edit
|
history
|
help
0
Clementina
СПКИ АП КЭП 2
133
ChiSq
Test1
cs
stack::emplace for 30-second c++
map_find
For Hello World
on_off