Boost logo

Boost :

From: Karl Nelson (kenelson_at_[hidden])
Date: 2001-12-19 13:35:22


Another question regarding the proposed formatted class.

Why use the operator "%" for combining items. It is not streamlike
and introduces precidence problems which C++ coders do not normally
have with streams. Previous discussions (when I submitted my formatting
class) here concluded operator << was a better choice.

--Karl

Ie.

#include<iostream>
ostream& operator % (ostream& os, ostream& (&manip)(ostream &))
  { return os << manip; }
ostream& operator % (ostream& os, int i)
  { return os << i; }

main()
{
  cout << 1+2 <<endl;
  cout % 1+2 % endl;
}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk