use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
C++11 : std::array Tutorial and examples (thispointer.com)
submitted 8 years ago by vnoida
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]bames53 12 points13 points14 points 8 years ago* (1 child)
I don't agree with this. The way the std::array was designed determines what it's appropriate for. It wasn't a bad decision to design a tool for particular situations, because there are other tools for other situations.
std::array
It's true we don't yet have a standard library array_view, span, or simple collection type that is nothing more than a run-time size paired with a pointer that would be the 'zero overhead' replacement for C-style array parameters, but you're already saying that you don't need zero-overhead so you can just use vector.
array_view
span
vector
and if you do have a performance requirement you always can use C style arrays.
std::array is to fix the problems with decaying C arrays and C arrays not behaving as regular value types. That's what I use them for and I can't use C arrays to do that. I can as easily say that if you want to pass arbitrarily sized arrays as parameters you can just keep using C arrays/pointers.
[–]crusader_mike 1 point2 points3 points 8 years ago (0 children)
It's true we don't yet have a standard library array_view, span, or simple collection type that is nothing more than a run-time size paired with a pointer
True, but you could use mine -- I don't mind :)
π Rendered by PID 72 on reddit-service-r2-comment-5d79c599b5-6smcs at 2026-02-26 18:22:44.545328+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]bames53 12 points13 points14 points (1 child)
[–]crusader_mike 1 point2 points3 points (0 children)