[READ-ONLY] Mirror of https://github.com/shuuji3/yasashii-cpp. Codes for "やさしいC++ 5th edition" books.google.co.jp/books?id=JHe2tAEACAAJ
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix a bug forgetting returning inserted ostream

+3 -1
+3 -1
src/override-class-show/main.cpp
··· 1 - // operator << をオーバーライドすることで、自分で定義したクラスを cout できるようにする 1 + // operator << をオーバーライドすることで、自分で定義したクラスを cout 2 + // できるようにする 2 3 #include <iostream> 3 4 4 5 class Point { ··· 17 18 18 19 std::ostream &operator<<(std::ostream &os, const Point &p) { 19 20 os << "Point{" << p.x << ", " << p.y << "}" << std::endl; 21 + return os; 20 22 } 21 23 22 24 int main() {