`
chenqi210
  • 浏览: 76699 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

inherit the ostream

    博客分类:
  • c++
 
阅读更多
class cdebug_stream :public ostream
{
public:
	typedef cdebug_stream& (*manip_fnptr)(cdebug_stream&);
	void attach(ostream& os) { m_outs.push_back(&os); }
	void detach(ostream& os) { m_outs.erase(std::remove(m_outs.begin(),m_outs.end(),&os),m_outs.end()); }
	template<typename T>
	cdebug_stream& operator << (T const& val) {
		for(vector<ostream*>::iterator it = m_outs.begin();
				it != m_outs.end();
				++it)
			(**it) << val;
		return *this;
	}
	cdebug_stream& operator << (ostream& (*manip)(ostream&)) {
		for(vector<ostream*>::iterator it = m_outs.begin();
				it != m_outs.end();
				++it)
			(*manip)(**it);
		return *this; 
	}
private:
	vector<ostream*> m_outs;
} cdebug;
 
0
0
分享到:
评论

相关推荐

    javascript的inherit

    inherit的编码,通过inherit来完成对类的继承,可以进行view或者model的继承,仿后端的object继承,很有用哦

    inherit.rar

    遗传算法对PID参数寻优源码,里面包括inherit,c,inherit.h,实现遗传算法函数以及如何应用于PID参数最优。

    inherit Delphi继承的演示..rar

    inherit Delphi继承的演示..rar

    C#例子代码 A0630_EF_Inherit_TPH

    C#例子代码 A0630_EF_Inherit_TPHC#例子代码 A0630_EF_Inherit_TPHC#例子代码 A0630_EF_Inherit_TPHC#例子代码 A0630_EF_Inherit_TPHC#例子代码 A0630_EF_Inherit_TPHC#例子代码 A0630_EF_Inherit_TPHC#例子代码 A...

    C#例子代码 A0631_EF_Inherit_TPT

    C#例子代码 A0631_EF_Inherit_TPTC#例子代码 A0631_EF_Inherit_TPTC#例子代码 A0631_EF_Inherit_TPTC#例子代码 A0631_EF_Inherit_TPTC#例子代码 A0631_EF_Inherit_TPTC#例子代码 A0631_EF_Inherit_TPTC#例子代码 A...

    inherit

    inherit

    THE-inherit--OF-java-CLASS.rar_The Class

    Java学习笔记;主要描述了Java类的继承的性质、特点,应用技巧等

    odoo10 inherit 继承练习

    odoo10 编写一个培训管理模块,其中有继承的使用 1. 输入和查询课程,把信息储存到课程对象里 2. 课程包含以下信息:名称,价格,天数,开始日期,教师,学员 3. 每个课程可以有多个学员,要记录学员的姓名、电话、...

    A Multi-Stage Modeling Framework for Web Service Composition

    net and defines it as an extended Petri net, in order to inherit the closure property of Petri nets. Some operators in the web service calculus are illustrated and mapped to the Petri nets operation. ...

    LDD3实例文件

    The files in ./pci ./tty and ./usb inherit the GPL from the kernel sources, as most of their code comes straight from the kernel (usb-skeleton.c being part of the kernel source tree directly.)

    计算机网络第五版答案

    计算机网络答案 第五版 详细、完美的!

    Hierarchical_State_Machine 源代码

    The states at the higher level in hierarchy perform the common message handling, while the lower level states inherit the commonality from higher level ones and perform the state specific functions....

    RefineDet论文

    To inherit the merits of both while overcoming their disadvantages, in this paper, we propose a novel single-shot based detector, called RefineDet, that achieves better accuracy than two-stage ...

    c++lianziirghiduhgkldjhgkljdnh

    Design two classes circle and table, and then based on the two classes define a new derived class roundtable by multi-inherit. The output of the program should include the height of the table, the ...

    The Object-Oriented Thought Process (3rd Edition)

    By designing with objects rather than treating the code and data as separate entities, OOP allows objects to fully utilize other objects’ services as well as inherit their functionality. OOP ...

    CSS中的inherit使用技巧小结

    大多数开发者都知道inherit关键字,但有几个新的CSS3继承特性你可能不知道… property: inherit;  inherit关键字代表“使用指定给父元素的所有值”。如果父元素中没有明确的值定义,浏览器搜寻DOM树直到找到相应的...

    inherit.js:在javascript中进行经典继承的强大、灵活、轻便和快速的工具

    var Person = inherit ( function ( ) {this . canSpeak = function ( ) {return true ;} ;} ) ;var Men = inherit ( Person , function ( ) {this . hasPenis = function ( ) {return true ;} ;

    前端大厂最新面试题-inherit.docx

    前端大厂最新面试题-inherit.docx

    maven-inherit-plugin-1.1.jar

    maven-inherit-plugin-1.1.jar

    maven-inherit-plugin-1.0.jar

    maven-inherit-plugin-1.0.jar

Global site tag (gtag.js) - Google Analytics