by xleviator · 7y ago · 0 comments
The main downside of Badge<T> is that it comes with a performance penalty and ABI change for something that should be statically deducible (empty struct is one byte in C++).
You can have a look here: https://godbolt.org/z/DmeYL-
The one byte rule does nothing here, because its value is undefined and its address not observable.
edit: if you find a case where an empty struct parameter causes code to be emitted, let's consider filing bugs.