Perfect Forwarding

Today, we solve " ... a herefore unsolved problem in C++" (Bjarne Stroustrup). To make the long story short, I will write about perfect forwarding.

Read more
Add CommentViews: 1363

Time for Wishes

I wrote more than 130 posts in my German blog about functional programming, embedded programming and multithreading programming with modern C++. My English blog will catch up in two months with my German one. Therefore, it's the right time to rework my blogs. The German blog and the English blog in parallel.

Read more
Comments 5Views: 598

Move Semantic: Two nice Properties

I will talk about two nice properties of the move semantic in this post that are not so often mentioned. Containers of the standard template library (STL) can have non-copyable elements. The copy semantic is the fallback for the move semantic. Irritated? I hope so!

Read more
Tags: memory
Comments 3Views: 3637

Copy versus Move Semantic: A few Numbers

A lot was written about the advantages of the move semantic to the copy semantic. Instead of an expensive copy operation you can use a cheap move operation. But, what does that mean? I will compare in this post the performance of the copy and move semantic for the containers the Standard Template Library (STL). 

Read more
Tags: memory
Comments 2Views: 1352

std::array - Dynamic Memory, no Thanks

std::array combines the best from two worlds. At one hand, std::array has the size and efficiency of a C array; at the other hand, std::array has the interface of a std::vector. 

Read more
Tags: memory
Comments 10Views: 6338

Automatic Memory Management of the STL Containers

One of the big advantages of C++ string to a C string and of a std::vector to a C arrays is it that both C++ containers automatically manage their memory. Of course, that holds true for all further containers of the Standard Template Library. In this post, I will have a closer look at the automatic memory management of std::vector and std::string.

Read more
Tags: memory
Comments 5Views: 2539

std::weak_ptr

std::unique_ptr models the concept of exclusive ownership, std::shared_ptr the concept of shared ownership. If I stick to this picture then std::weak_ptr models the concept of temporary ownership because it borrows the resource from a std::shared_ptr. There is one dominant reason for having a std::weak_ptr in C++: breaking of cyclic references of std::shared_ptr's.

Read more
Add CommentViews: 1620

Support my blog by buying my E-book

Latest comments

Modernes C++

Subscribe to the newsletter

Including two chapters of my e-book
Introduction and Multithreading

Blog archive

Source Code

Visitors

Today 572

All 219842

Currently are 103 guests and no members online