I want to provide a tab for C ++ text output streams. The function should allow me to say “mark this position,” then allow several insert operations, and finally let me say “add enough padding characters so that eventually there are Ncharacters that have passed the originally marked position.”
The standard system iostreamdoes not seem to support the column position, but I thought I could fake it using tellp(). My assumption was that the difference between tellp()the two points in my output sequence would correspond to the number of intermediate bytes.
Unfortunately, at least in my environment, Gnu C ++ coutdoes not support thread position fiction. Every challenge cout.tellp() returns -1. Why is this?
source
share