explicit(To Be || !(To Be))

explicit(bool) C++20 feature discussion, motivation, usage example, proposal and more. Basic explanation about explicit and implicit conversions pros and cons.

New Discord & Telegram servers

You can now discuss about new articles, offer ideas for the next posts, and get updates about the blog on our new Discord server and Telegram channel. Stay tuned!

[Solution] Riddle – The Shared View

The Shared View riddle solution. Involves usage example of shared_ptr aliasing constructor, design patterns reflection and factory, metaprogramming, string_view and variant/visit.

Riddle – The Shared View

C++ Riddle - involves shared_ptr, string_view and some metaprogramming.

The Mystery of The Missing Bytes

How to save bytes and alignment when containing some types inside a structure. Techniques to avoid wasting space on unique_ptr deleter and on another structures allocators like std vector or map. Taking into account Empty Base Optimization (EBO) and no_unique_address attribute sice C++20. Internal GCC and LLVM compilers implementations.

The Shared The Unique and The Weak – Initialization – Part 2

unique_ptr and weak_ptr constructors, initializers and usage examples. make_unique advantages and disadvantages. unique_ptr custom deleters usage examples and important notes to pay attention to.

The Shared The Unique and The Weak – Initialization – Part 1

Shared ptr allocations, initializations, and behind the scenes functionality. Constructors' usage summaries, the aliasing conatructor, make_shared & allocate_shared advantages and disadvantages.

The Shared, The Unique and The Weak

Smart memory management - the ability to maintain pointers "without worrying when they should be released" sounds really utopic, but is it really the entire truth about "smart pointers"?

Design Patterns: RunTime Reflection – C++

One of the most desired Design Patterns is reflection- The ability to use classes metadata (names, functions, properties, etc...) at runtime. By default this is not possible on C++, and sometimes the selected solution is to use macros, but today we are going to archive it without them.

Design Patterns: Decorators – C++

Design Patterns were always different in C++, and a usual use of these patterns in C++ might cause more complications and problems in this language. In this series of articles, Iโ€™ll show how to correctly implement them in C++. In this article weโ€™ll see how to implement a compile-time Decorator.