simplecpp icon indicating copy to clipboard operation
simplecpp copied to clipboard

avoid direct usage of `std::cout`

Open firewave opened this issue 4 months ago • 2 comments

firewave avatar Aug 15 '25 21:08 firewave

Not directly specifying any stream is good style as you do not want some "random" print something. It would also allow to use it in more contexts.

Not sure about calling it directly from the debugger since I rarely do that. I thought about adding a default parameter but I did not want to have the <iostream> include in the header.

firewave avatar Aug 22 '25 13:08 firewave

Integrating the proposed API while maintaining the possibility to just call the function seems like a reasonable trade-off to finalize this.

Like I said that would introduce the <iostream> header which it is one of the heavier headers that and as it is just debug code that seems unnecessary to spill into user code.

Also we could use default parameters which would require less code.

firewave avatar Aug 26 '25 06:08 firewave