RE: formatting streams

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Fri, 10 Nov 2006 12:31:05 -0600


Hi Lee,  

Once we have made the switch to use Reflex in the implementation of CINT, we shall return to
enhancing CINT. This would then be a good time to add a better support for the iostream manipulator.

Cheers,
Philippe


From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Lee, Kerry T. (JSC-SF)[LMIT] Sent: Thursday, November 09, 2006 12:47 PM To: roottalk_at_pcroot.cern.ch
Subject: [ROOT] formatting streams

Dear Rooters (but most likely this is for Masa)

I am using ROOT version 5.13.01 on a linux box with gcc 3.4.4.

When executing fomatting commands of streams on the CINT command line, some work and others don't. Here is an example:

 #include <iomanip>
double a = 2.0
 double b = 1.1
 cout<<std::setw(10)<<a
  // 2(class ostream)116863616
cout<<std::showpoint<<a
//0xbe80362(class ostream)116863616

cout<<std::showpoint<<b
//0xbe80361.1(class ostream)116863616

There is a workaround by using cout.setf(), but this is not as nice as doing "on-the-fly" formatting.

root [6] cout.setf(ios::showpoint)
(ios_base::fmtflags)4098
root [7] cout<<b
1.10000(class ostream)116863616
root [8] cout<<a
2.00000(class ostream)116863616

Is it possible to include the other formatting manipulations to work like the std::setw() command on the CINT command line?

Thanks
Kerry Received on Fri Nov 10 2006 - 19:32:08 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:01 MET