【发布时间】:2011-02-27 12:44:40
【问题描述】:
我需要编写一个类,该类将通过像 cout 那样的运算符接受 boost::format() :
cout << boost::format("some string; some param = %d\n") % someValue;
运算符的参数必须是哪种类型? 这样该类将像这样声明:
class Output
{
Output& operator<<(... format);
}
int main()
{
Output output;
output << boost::format("...");
}
谢谢。
【问题讨论】:
标签: c++ string-formatting boost-format