template24.c

来自「gcc3.2.1源代码」· C语言 代码 · 共 23 行

C
23
字号
// Bug: g++ doesn't find the conversion from ostream_withassign to ostream.#include <iostream>template <class T>struct A {  T t;};template <class T>std::ostream & operator<< (std::ostream & os, A<T> & a){  os << a.t;  return os;}int main (){  A<int> a = { 1 };  std::cout << a << std::endl;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?