Short solution: I'm using a class now. But shouldn't formattedWrite take it's output range by ref? Does anyone else have a use case for this and might this cause any problems?
I want to print a tree structure and need to keep track of the
indention for different parts of the tree. My idea was to write a
generic wrapper for an output range that outputs tabs when it
encounters a newline. This wrapper has internal state and if I
want to use formattedWrite with this wrapper than state changes
don't propagate to the calling context because by value semantics.
- Should formattedWrite take the outputrange by ref? Tobias Pankrath
- Re: Should formattedWrite take the outputrange by ref... monarch_dodra
- Re: Should formattedWrite take the outputrange by... bearophile
- Re: Should formattedWrite take the outputrang... Tobias Pankrath
- Re: Should formattedWrite take the output... monarch_dodra
- Re: Should formattedWrite take the o... Tobias Pankrath
- Re: Should formattedWrite take t... Tobias Pankrath
- Re: Should formattedWrite ta... monarch_dodra
- Re: Should formattedWrite take the outputrange by ref... anonymous