Closed GoogleCodeExporter closed 9 years ago
1. Принято cpp/h файлы называть одинаково.
Например:
TDateTime.h/TDateTime.cpp. Тогда понятно, что в *.h лежит
интерфейс, а в соответствующем *.cpp -
реализация.
2. Пишу в main() следующий код:
TDateTime dt = TDateTime::Now();
cout << dt << endl << endl;
TTimeSpan ts(1, 1, 1);
cout << (dt + ts) << endl << endl;
dt = dt + ts;
cout << dt << endl << endl;
dt -= ts;
cout << dt << endl << endl;
Пробую компилировать. Получаю:
main.cpp: In function ‘int main()’:
main.cpp:119: error: no match for ‘operator=’ in ‘dt = dt.
TDateTime::operator+(((const TTimeSpan&)((const TTimeSpan*)(& ts))))’
my_time.h:69: note: candidates are: TDateTime& TDateTime::operator=(TDateTime&)
main.cpp:121: error: no match for ‘operator-=’ in ‘dt -= ts’
Решение не принято.
Original comment by aivyu...@gmail.com
on 10 May 2013 at 11:13
Original comment by iakovenk...@gmail.com
on 21 May 2013 at 10:48
Решение принято.
Original comment by aivyu...@gmail.com
on 26 May 2013 at 12:05
Original issue reported on code.google.com by
iakovenk...@gmail.com
on 2 May 2013 at 6:37