Move ostream support to ostream.{h,cc}

This commit is contained in:
Victor Zverovich
2016-05-06 07:37:20 -07:00
parent 041725e9d0
commit 90730e706b
12 changed files with 423 additions and 306 deletions

View File

@ -78,11 +78,7 @@ class BasicTestString {
public:
explicit BasicTestString(const Char *value = EMPTY) : value_(value) {}
friend std::basic_ostream<Char> &operator<<(
std::basic_ostream<Char> &os, const BasicTestString &s) {
os << s.value_;
return os;
}
const std::basic_string<Char> &value() const { return value_; }
};
template <typename Char>
@ -90,3 +86,13 @@ const Char BasicTestString<Char>::EMPTY[] = {0};
typedef BasicTestString<char> TestString;
typedef BasicTestString<wchar_t> TestWString;
class Date {
int year_, month_, day_;
public:
Date(int year, int month, int day) : year_(year), month_(month), day_(day) {}
int year() const { return year_; }
int month() const { return month_; }
int day() const { return day_; }
};