niedz., 12 paź 2025 o 11:49 Michel Morin via Boost <boost@lists.boost.org> napisał(a):
That's not what {} does by convention. It should output shortest roundtrip.
That probably means round-tripping of values (i.e. ignoring cohorts). It would be nice to support a cohort-aware formatter. For example, "%Da" in C23 printf provides a round-trip representation that distinguishes cohorts (though not the shortest one).
Hashing and equality aside, do users need to know which cohort-member is used for representation while formatting the value? Why would you like to know this? I imagine that this could be left as an implementation detail. This has performance implications, but the contract of the types should be talking about the performance trade-offs (like between fast and non-fast implementations) directly, not cohorts. Regards, &rzej;
Another cohort-related topic: Finite values have cohorts. Additionally, zero has both +0 and -0, and infinity has multiple bit representations. So we cannot hash decimal FP numbers simply by delegating to hash functions for unsigned integer types. We may need to canonicalize numbers before hashing.
Regards, Michel _______________________________________________ Boost mailing list -- boost@lists.boost.org To unsubscribe send an email to boost-leave@lists.boost.org https://lists.boost.org/mailman3/lists/boost.lists.boost.org/ Archived at: https://lists.boost.org/archives/list/boost@lists.boost.org/message/ZTMXP4YE...