Nick Voronin <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #2 from Nick Voronin <> 2010-12-15 09:59:49 PST ---
My thoughts:

1. Using Range interface for formatting classes and structs is a good thing and
should stay.

2. There is a conflict of priority between using toString and iterating through
a Range. It's worse for classes where toString is always present and can't be
used to deduce programmer's intent. IMHO it's more important to keep things
uniform, than to make best guess in every case, so iterating through range must
have priority over using toString. At least unless there is more direct way to
tell what's programmer's intent about default formatting of struct or class.

3. Range with (ElementType!T == T) must be either detected throughout all
library as a special case or not detected as a Range at all. I'm under
impression that algorithms (not just formatting routines) expect that front()
yields some value. This value /may/ be another Range, there may be hierarchical
structures containing Ranges of Ranges, yet this hierarchy is expected to be
finite, so full traversal of it is possible. I expect there are more trouble
waiting to happen with Ranges like that if they go generally undetected. I may
be wrong here, it would be great to have someone with knowledge of both current
practice and original intent clarify this matter.

> Also, the online doc does not hold template constraints, so that it is not 
> possible to determine which one is selected in given situations.

5. attached a testcase of various combination (class|struct, normal
range|recursive range|no range, has override for toString|no override toString)
and patch which makes all cases compile and print uniform output for struct and
class. For this case changes are really very simple, constraints still look
manageable, and one can still enjoy specific formatting for ranges.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to