So I came about a question about std::reduce which lead me to an example on. cppreference.com
In this example I saw the following std::vector declaration:
std::vector<double> v(10'000'007, 0.5);
What are these quotes doing here? I've never seen this before anywhere. Is this a new kind of C++ feature that I should know about?
This is a new feature in C++14. From cppreference:
Optional single quotes(') may be inserted between the digits as a separator. They are ignored by the compiler.
It appears to be a digit separator, as described in here: http://www.informit.com/articles/article.aspx?p=2209021
So, this code should be equivalent to
std::vector<double> v(10000007, 0.5);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With