Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
LOOL
#include <iostream> #include <set> using namespace std; set<string> stringSet; struct StringStruct { string str; }; void referencePass(StringStruct & str) { stringSet.insert(str.str); } void insertIntoGlobal() { for (int i = 0; i < 2; i ++) { string asdf; cin >> asdf; StringStruct a = {asdf}; referencePass(a); } } int main() { insertIntoGlobal(); for (auto itr : stringSet) { cout << itr << endl; } return 0; }
run
|
edit
|
history
|
help
0
bubble sort
Access to temporary object
HexDong
7
ternary test
MPL 2-0
Division by zero exception example
001
nontype template parameter produced with decltype for function
6 7