Strong types are a way to put names over data in code in order to clarify your intentions, and the more I work on it the more I realize how deep a topic that is. So far we’ve seen the following subjects in our series on strong types: Strongly typed constructors Strong types for strong interfaces […]
Metaclasses are a very popular C++ feature that Herb Sutter proposed for the language a couple of weeks ago. I think that metaclasses are a structural change to the language if they are accepted, and this is why you should get familiar with it. The paper dedicates a small subsection on the subject of how […]
Strong types are types that are built over primitive types, and add meaning to them. My purpose today is two-fold: showing you how to write an STL-compliant hash function for custom types so that they can be used in unordered containers such as std::unordered_map, making a hash function available for strong types. For more about the motivation […]
Strong types are a way to add a meaning to objects by giving them a meaningful name, by using types. This lets the compiler, human beings, and developers understand better the intent of a piece of code. We’ve been exploring strong types on Fluent C++. I focus here on how to define strong types conversions. If you want to catch […]
On Fluent C++ we had already considered passing strong types by references, and realized that this wasn’t such a simple thing to do. To understand why, I suggest you read the problem statement in this previous post before starting this one, so that we are in line. So far the series on strong types contains […]
This post is a new one in the series about strong types. I didn’t intend the series to contain more than 3 posts initially, covering the topics of strong types to make interfaces clearer and more robust. But I later encountered a need, still about strongly typing interfaces and that I shall describe in the motivation […]
In this post in the series about strong types, we focus on the need for passing strong types by reference. This is a fairly common use case for strong types, since passing arguments by reference is so common, but I haven’t seen this aspect of strong types treated anywhere else yet. This post is part of the following series: […]
Strong types are a popular topic in the C++ community. In this post I want to focus specifically on how they can be used to make interfaces clearer and more robust. This post in the second one in the series on strong types: Strongly typed constructors Strong types for strong interfaces Passing strong types by reference Strong […]
This is the first post of a series on the topic of expressive types, that is, types that express what they represent, rather than how they are implemented. By carrying meaning, these types improve the readability and safety of the code. Here is the series about strong types: Strongly typed constructors Strong types for strong interfaces Passing […]