close
Namespaces
Variants

Talk:cpp/iterator/begin

From cppreference.com

In the second version of (1), there is no difference between C++11 and C++17 listed.

I suppose constexpr is missing? — Preceding unsigned comment added by 83.236.148.156 (talkcontribs)

Yes. Fixed, thanks! T. Canens (talk) 00:26, 11 May 2016 (PDT)

Why does the for_each example take Container by rvalue reference? It never std::forwards the parameter anywhere.

probably FJW had something it mind when it was added, but it does appear to be unnecessary. --Cubbi (talk)
So that you can call it on rvalue containers too? It's basically used as a "universal" reference that accepts everything. T. Canens (talk) 12:51, 20 September 2016 (PDT)
oh, f(*it) could be mutating, that's why? --Cubbi (talk) 21:44, 20 September 2016 (PDT)

In declaration #2, i have a question about the parentheses. In the declaration template< class T, std::size_t N > constexpr T* begin( T (&array)[N] );, are the parens around &array necessary, because without them, this declares a function taking an array of N references to T, which is disallowed by the standard?

"See below" points to nowhere

The "see below" for (3) points to nowhere, as there's nothing, further down the entry, about the conditional noexcept. 93.62.124.8 09:26, 3 May 2018 (PDT)

It points to the Exceptions section. T. Canens (talk) 19:22, 3 May 2018 (PDT)
Aha! I had missed it, thanks! Maybe changing "see below" to "see Exceptions"? 93.62.124.8 07:38, 4 May 2018 (PDT)