Using the logic that we should use tools that are as simple as possible and only adopt complexity where it is absolutely necessary, it feels like I could use a very early version of C++. What follows are the reasons why I have increased that to C++17. The idea will be to only use these feature and no more. Any new use will be add to this page.
#if !((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
#error Requires C++17 or higher
Continue reading “Reasons for Using C++ 17”
This started out as a task to learn simple class inheritance. To work out the syntax and idiomatic way to use them in C++. I just kept typing things that I thought would work and the compiler would slowly teach me what was wrong.
class rectangle : public shape
rectangle(float half) : shape(half)
Continue reading “Easy to Make Mistakes in Class Inheritance”
In learning C++ I dug in and tried to use classes and templates to solve what feels like a typical use case. I found that what I needed was Template Specialisation and that C++ does not support this very well. I came up with 3 different methods and wanted to check what others though was we the best approach. If there was a “preferred idiom in C++”, or an even better solution.
Continue reading “Asking Stack Overflow the best way to do Template Specialisation”