5

How can I make non-primitive types A and B two distinguishable types in order to add type safety to the interface of function f?

constexpr std::size_t type_size{ 8U };
using A = std::array<char, type_size>;
using B = std::array<char, type_size>;

constexpr auto f(A const a, B const b)
{
   // Not shown logic here.
}
user2672165
  • 2,986
  • 19
  • 27

0 Answers0