diff --git a/au/io.hh b/au/io.hh index 26c8165c..f52464ff 100644 --- a/au/io.hh +++ b/au/io.hh @@ -25,6 +25,11 @@ namespace au { // Streaming output support for Quantity types. template std::ostream &operator<<(std::ostream &out, const Quantity &q) { + // In the case that the Rep is a type that resolves to 'char' (e.g. int8_t), + // the << operator will match the implementation that takes a character + // literal. Using the unary + operator will trigger an integer promotion on + // the operand, which will then match an appropriate << operator that will + // output the integer representation. out << +q.in(U{}) << " " << unit_label(U{}); return out; }