title: c++ persisten iomanipulation
body: <p>So I have some code which looks like this </p>
  
  <pre><code>debug_file &lt;&lt; left &lt;&lt; setw(10) &lt;&lt; timestamp &lt;&lt; left 
  &lt;&lt; setw(10) &lt;&lt; activity_type &lt;&lt; left &lt;&lt; setw(10) &lt;&lt; key &lt;&lt; setw(10) 
  &lt;&lt; left &lt;&lt; event_data1 &lt;&lt; setw(10) &lt;&lt; left &lt;&lt; event_data2 &lt;&lt; setw(10) 
  &lt;&lt; left &lt;&lt; event_data2 &lt;&lt; endl;
  </code></pre>
  
  <p>i would like to be able to write</p>
  
  <pre><code>// all output to debug_file defaults to left justify unless specified
  // all output to debug_file defaults to setw(10)
  debug_file &lt;&lt; timestamp &lt;&lt; activity_type &lt;&lt; key &lt;&lt; event_data1 &lt;&lt; event_data2 
  &lt;&lt; event_data3 &lt;&lt; endl;
  </code></pre>
  
  <p>first of all, I'm not quite sure what this behaviour is called. Second, I don't know where in iomanip to look in order to do it. Now that I'm writing this I came up with the idea of making function which takes any input type and just does &lt;&lt; left &lt;&lt; setw(10) &lt;&lt; input, but I'm still interested in if there's a pre-built solution.</p>