From ee7caf494ec226929ee167f57147dc7aacbbba17 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sun, 6 Oct 2024 08:05:10 +0200 Subject: [PATCH] docs: `better_type_name` description added in a comment --- src/core/include/mp-units/ext/type_name.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/include/mp-units/ext/type_name.h b/src/core/include/mp-units/ext/type_name.h index 03d7e6ec..d368f869 100644 --- a/src/core/include/mp-units/ext/type_name.h +++ b/src/core/include/mp-units/ext/type_name.h @@ -37,6 +37,10 @@ template return name; } + +// This is typically used to deterministically chose one of the alternatives +// to guarantee the commutation of the operation (e.g., `a + b` should return +// the same type as `b + a`). template [[nodiscard]] consteval auto better_type_name(T1 v1, T2 v2) {