提交 ecd4372f 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

cheap version of ostreams for scopedperf

上级 0b5352c5
......@@ -64,6 +64,37 @@ namespace std {
{
return static_cast<typename remove_reference<T>::type&&>(a);
}
class ios_base {};
class ostream : public ios_base {};
extern ostream cout;
static inline
ostream& operator<<(ostream &s, const char *str) {
cprintf("%s", str);
return s;
}
static inline
ostream& operator<<(ostream &s, u32 v) {
cprintf("%d", v);
return s;
}
static inline
ostream& operator<<(ostream &s, u64 v) {
cprintf("%ld", v);
return s;
}
static inline
ostream& operator<<(ostream &s, ostream& (*xform)(ostream&)) {
return xform(s);
}
static inline ostream& endl(ostream &s) { s << "\n"; return s; }
static inline ostream& left(ostream &s) { return s; }
static inline const char *setw(int n) { return ""; }
}
/* C++ runtime */
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论