Skip to content

Instantly share code, notes, and snippets.

@minjang
Last active December 23, 2015 17:00
Show Gist options
  • Save minjang/f6ed075a7c44760d5677 to your computer and use it in GitHub Desktop.
Save minjang/f6ed075a7c44760d5677 to your computer and use it in GitHub Desktop.
// 3. const 예제
cout << "[TEST 3] const\n";
const string E[] = {"foo", "bar", "baz"};
// decltype(p) == pair<size_t, string const&>&&
// p 자체는 상수가 아니므로 인덱스 값은 변경 가능, 배열 값은 수정 불가.
for (auto &&p : enumerate(E))
cout << (p.first += 1) << ": " << p.second << '\n';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment