Archive for December, 2017

C++17: constexpr if

Written by on December 17, 2017 in C++, Programming with 0 Comments
C++17: constexpr if

constexpr if is another nice little feature in C++17, which significantly simplifies the way we code, especially in the context of templates. In this article, I will briefly talk about this feature and look at some examples. constexpr if is a variant of the standard if statement we have had all along. The primary difference  […]

Continue Reading

C++17: std::any

Written by on December 3, 2017 in C++, Programming with 0 Comments
C++17: std::any

In the previous two posts, I talked about std::variant<> and std::optional<>. Today, I want to take up std::any for discussion. The type any (implemented by the class any) allows a variable to hold a single value of any type. More interestingly, the type of the value held by a variable of type any can even […]

Continue Reading

Top