サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
Pixel 9
www.cppstories.com
As of C++20, we have four keywords beginning with const. What do they all mean? Are they mostly the same? Let’s compare them in this article. const vs constexpr const, our good old fried from the early days of C++ (and also C), can be applied to objects to indicate immutability. This keyword can also be added to non-static member functions, so those functions can be called on const instances of a
C++20’s Ranges offer alternatives for most of <algorithm>'s'. This time I’d like to show you ten non-modifying operations. We’ll compare them with the “old” standard version and see their benefits and limitations. Let’s go. Before we start Key observations for std::ranges algorithms: Ranges algorithms are defined in the <algorithm> header, while the ranges infrastructure and core types are defined
In this blog post I’ll show you a couple of interesting examples with lambda expressions. Do you know how to write a recursive lambda? Store them in a container? Or invoke at compile time? See in the article. Updated in August 2022: Added C++23 improvements. 1. Recursive Lambda with std::function Writing a recursive function is relatively straightforward: inside a function definition, you can call
When you see an article about new C++ features, most of the time you’ll have a description of major elements. Looking at C++17, there are a lot of posts (including articles from this blog) about structured bindings, filesystem, parallel algorithms, if constexpr, std::optional, std::variant… and other prominent C++17 additions. But how about some smaller parts? Library or language improvements that
MSVC (VS 2017 15.7, end of June 2018) is as far as I know the only major compiler/STL implementation that has parallel algorithms. Not everything is done, but you can use a lot of algorithms and apply std::execution::par on them! Have a look at few examples I managed to run. Introduction Parallel algorithms look surprisingly simple from a user point of view. You have a new parameter - called execu
C++ grows very fast! For example, the number of pages of the C++ standard went from 879 pages for C++98/03 to 1834 for C++20! Nearly 1000 pages! What’s more, with each revision of C++, we get several dozens of new features. Have a look at my blog post with all C++17 features, it shows 48 items, and my C++20 reference card lists 47 elements! Do you need to learn all of that stuff to write good code
The ISO Committee accepted and published the C++17 Standard in December 2017. In this mega-long article, I’ve built (with your help!) a list of all major features of the new standard. Please have a look and see what we get! Language Features New auto rules for direct-list-initialization static_assert with no message typename in a template template parameter Removing trigraphs Nested namespace defi
Back in 2016, an intriguing article appeared on Reddit: “Do Experienced Programmers Use Google Frequently?”. The author discussed if expert programmers use google more often than novice coders. He mentioned that using google is a good thing. It helps to find the best solutions, validate ideas, speed the development. Google nowadays seems to be a crucial part of any developer toolbox. That reminded
Visual Studio is my main development environment. I’ve been using this tool probably since version 2003…2005. I am really happy that VS is getting more and more powerful these days and you can also use it on multiple-platforms (through VS Code, for web or cloud apps). What’s even better - it’s free for personal use or if you’re a small company (Community Version)! Today, I’ve prepared some product
Memory access patterns are one of the key factors for writing efficient code that runs over large data sets. In this blog post, you’ll see why there might be a perf difference of almost 2.5x (in both directions!) when working with a vector of pointers versus a vector of value types. Let’s jump in. Use Cases Let’s compare the following cases: std::vector<Object> std::vector<std::shared_ptr<Object>>
このページを最初にブックマークしてみませんか?
『www.cppstories.com』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く