Categories
C++Programming

Requires clause for overload resolution – real-world example

Intro This is the third (and probably last) article of my small mini series about maybe not so well known C++ features / pattern / programming techniques for which I found a practical usage during programming on my private projects. This time the topic is about the requires clause for overload resolution. The requires clause […]

Categories
C++Programming

An unevil const_cast – real-world example

Intro This is the second article of my small mini series about maybe not so well known C++ features / pattern / programming techniques for which I found a practical usage during programming on my private projects. This time the topic is about const_cast<T&>. const_cast is considered evil It is more or less indisputable, that […]

Categories
C++Programming

Ref-qualified overloads – real-world example

Intro This article is the first one of a small mini series of C++ related articles where I will show and explain some C++ features, which might be a little uncommon in its usage at least for some (or even many?) of C++ programmers – probably because the practical usage of these features is not […]

Categories
C++Programming TeaScript

Script Language comparison for embed in C++

Intro Sometimes you need to extend your C++ Application dynamically during runtime with something what is not known at compile time yet. For easy things you can provide config files which may be changed prior before the application is started. The Application reads the config files on startup and use the contained settings accordingly. But […]

Categories
C++Programming

TOP 5 most astounding C++20 Syntax

โ† Welcome ๐Ÿ‘‹ to my ๐ŸŽ„๐ŸŽ…๐ŸŽ Christmas ๐ŸŽ„๐ŸŽ…๐ŸŽโœจ Specialโœจ โ†โ˜ƒ! Today I present you my personal TOP 5 most astounding C++20 syntax constructs. Hope you will enjoy and maybe will see something new and/or interesting. Here it goes: No. 5: This line creates an empty lambda and directly executes it. Effectively, you can consider it […]

Categories
C++Programming

Unions are almost always a bad idea.

This post was viewed [wpstatistics stat=pagevisits time=total id=748] times. To use a classical union from C is almost always a bad idea in C++ and you should use std::variant instead. I show you why. And I also will show you in which big(!) trap I ran into myself with a union. We start with a […]

Categories
C++Programming

Quick and easy way to share Visual Studio settings in Git.

For rapid prototyping you donโ€™t need to deal with cmake at all for can work in small groups or on different machines โ€“ the Visual Studio Property Sheets explained!

Categories
C++Programming

The best Visual Studio settings for modern C++ ?!

This post was viewed [wpstatistics stat=pagevisits time=total id=528] times. Following a list of my preferred and maybe (?) best Visual Studio settings for modern C++ programming based on my experience and evaluations. Each mentioned setting will be explained with some short sentences. I will cover โ€œReleaseโ€ Builds only – and I use Visual Studio 2022, […]

Categories
C++Programming

C++ as a standalone script?

Since my early days as a C++ developer I wanted to use C++ code snippets as a standalone script file. Like just type the following C++20 code snippet (see my previous blog post) in a file and then execute it: But how can this be made possible?? Develop an interpreter which supports the complete set […]

Categories
C++Programming

Design by Introspection (C++20)

Some time ago I stumbled upon a very interesting (and for me new) technique named โ€œDesign by Introspectionโ€, which is easily possible with the concept feature of C++20. This technique can be illustrated by the following small code snippet: First the parameter of the function value is of type auto, so it will be set […]