Last active
December 23, 2015 17:02
-
-
Save minjang/a5ce4b47fd1c65162850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 5. 변수를 거치지 않고 직접 사용 | |
cout << "[TEST 5] in-place through rvalue reference\n"; | |
for (auto &&p : enumerate(range(100, 103))) | |
cout << p.first << ": " << p.second << '\n'; | |
// decltype(p) == pair<size_t, string&>&& | |
for (auto &&p : enumerate(vector<string>{"foo", "bar", "baz"})) | |
cout << p.first << ": " << (p.second += p.second) << '\n'; | |
// 함수 반환값 바로 사용 | |
auto create = []()->vector<string> { return {"foo", "bar", "baz"}; }; | |
// decltype(p) == pair<size_t, string&>&& | |
for (auto &&p : enumerate(create())) | |
cout << p.first << ": " << p.second << '\n'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment