Enumerations and Class Enumerations in C++ πŸ‘‹

Enumerations are always fun to use in C++ programs. C++ core guidelines define eight different rules to define the enumerations. And also, C++11 introduced the scoped enumerations also called as class enumerations. Scoped enums also have few advantages over plain enums which are also covered in this article.

A Taxonomy of Expression Value Categories in C++πŸ‘‹

C++ had value categories in C++0X version. The two value categories that were before C++11 are lvalues and rvalues. One of the greatest addition to C++11 was the introduction of movable types. Learning about the value categories is one of the pre-requisites to learn about move semantics. Any expression before the C++11 standard was either lvalue or rvalue. lvalue has an identity and its lifetime depends on the scope of the variable. On the other hand, rvalues don't have an identity and it does not live beyond the life of the expression.

Using Templates for Generic Programming - Part 1 (Embracing the beauty of SFINAE and enable_if)πŸ‘‹

C++ template programming: SFINAE, std::enable_if, std::enable_if_t, if constexpr, perfect forwarding. In this blog post, we will learn advanced template programming concepts. These concepts include how to change the implementation of classes and functions based on the type provided, how to work with different arguments and how to properly forward them, how to optimize the code in both runtime and compile-time, about SFINAE, std::enable_if, std::enable_if_t.

Function Templates in C++ πŸ‘‹

Overloaded functions have the same code but the type is different. It seems an unnecessary overhead to write the same code again and again and in a long time it adds up to the maintenance cost of the project. To write code once and use it multiple times we use function templates. A function template is itself is not a definition of a function; it is a blueprint for defining a family of functions.

Volatile Keyword in C and C++ πŸ‘‹

Quoting from the C++ Standard ($ [..] volatile is a hint to the implementation to avoid aggressive optimization involving the object because the value of the object might be changed by means undetectable by an implementation.[…]