Partners: KDAB Whole Tomato Software CppDepend

10 August 2018

C++17 In Detail Book!

C++17 In Detail

I’m happy to present my first ebook on C++!

Here’s the short story and the description of what you can find inside.

Plus, read on and see how to get a free copy :)

06 August 2018

How to Initialize a String Member

How to init string member

How do you initialise a string member in the constructor? By using const string&, string value and move, string_view or maybe something else?

Let’s have a look at possible options.

30 July 2018

Speeding Up string_view String Split Implementation

String_View Performance Followup

Thank you for all the comments about the string_view performance! Last week I got a lot of feedback on how to improve the initial string split code.

Have a look at how can we update the code and get some better performance.

23 July 2018

Performance of std::string_view vs std::string from C++17

Using std::string_view from C++17

How much is std::string_view faster than standard std::string operations?

Have a look at a few examples where I compare std::string_view against std::string.

16 July 2018

In-Place Construction for std::any, std::variant and std::optional

in place construction for C++17

When you read articles or reference pages for std::any, std::optional or std::variant you might notice a few helper types called in_place_* available in constructors.

Why do we need such syntax? Is this more efficient than “standard” construction?

09 July 2018

Menu Class - Example of Modern C++17 STL features

Writing articles about modern C++ features is a lot of fun, but what’s even better is to see how you use those new things in real world.

Today I’m happy to present a guest post article from JFT who was so kind to describe his project where he uses several C++17 features.
He shared the process of building a menu that is based on std::any, std::variant and std::optional.

Have a look!

02 July 2018

Parallel STL And Filesystem: Files Word Count Example

Parallel algorithms and Filesystem

Last week you might have read about a few examples of parallel algorithms. Today I have one more application that combines the ideas from the previous post.

We’ll use parallel algorithms and the standard filesystem to count words in all text files in a given directory.

25 June 2018

Examples of Parallel Algorithms From C++17

Examples of Parallel STL from C++17

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.

18 June 2018

Everything You Need to Know About std::any from C++17

Using std::any in C++17

With std::optional you can represent some Type or nothing. With std::variant you can wrap several variants into one entity. And C++17 gives us one more wrapper type: std::any that can hold anything in a type-safe way.

11 June 2018

A Wall of Your std::optional Examples

std::optional contest

Two weeks ago I asked you for help: I wanted to build a wall of examples of std::optional. I’m very grateful that a lot of you responded and I could move forward with the plan!

You’re amazing!

Let’s dive in the examples my readers have sent me!

04 June 2018

Everything You Need to Know About std::variant from C++17

Using std::variant in C++17

Around the time C++17 was being standardized I saw magical terms like “discriminated union”, “type-safe union” or “sum type” floating around. Later it appeared to mean the same type: “variant”.

Let’s see how this brand new std::variant from C++17 works and where it might be useful.

28 May 2018

Show me your code: std::optional

std::optional contest

Show me your code!

I’d like to run a little experiment.

Let’s build a wall of examples of std::optional!

21 May 2018

Error Handling and std::optional

Error handling and std::optional

In my last two posts in the C++17 STL series, I covered how to use std::optional. This wrapper type (also called “vocabulary type”) is handy when you’d like to express that something is ‘nullable’ and might be ‘empty’. For example, you can return std::nullopt to indicate that the code generated an error… but it this the best choice?

14 May 2018

C++ Templates - The Complete Guide 2nd Book Review

C++ Templates - The Complete Guide 2nd Book review

A few months ago I received a quite massive mail package with something that was looking like a brand new C++ book :)

My initial plan was to review it quickly, maybe in one month. But I failed, as learning C++ templates is not that easy :) I needed much more time.

Time passed by and now I am ready for the review, so here you have it :) See my thoughts about the fantastic book on C++ templates, “the templates book” as many people call it.

© 2017, Bartlomiej Filipek, Blogger platform
Any opinions expressed herein are in no way representative of those of my employers.
This site contains ads or referral links, which provide me with a commission. Thank you for your understanding.