divyang4481 / mipt-hw

Automatically exported from code.google.com/p/mipt-hw
0 stars 0 forks source link

task04_TGeometry(Савинова) #197

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
/savinova_anna/task04_Geometry/

без многоугольника

Original issue reported on code.google.com by anna.sav...@phystech.edu on 3 Apr 2013 at 9:05

GoogleCodeExporter commented 9 years ago
0. Ошибка компиляции:
TGeom.cpp: In member function ‘bool TCircle<T>::Intersects(const 
TSegment<T>&) const’:
TGeom.cpp:137: error: there are no arguments to ‘sqrt’ that depend on a 
template parameter, so a declaration of ‘sqrt’ must be available
TGeom.cpp:137: error: (if you use ‘-fpermissive’, G++ will accept your 
code, but allowing the use of an undeclared name is deprecated)
TGeom.cpp:138: error: there are no arguments to ‘sqrt’ that depend on a 
template parameter, so a declaration of ‘sqrt’ must be available
TGeom.cpp: At global scope:
TGeom.cpp: In instantiation of ‘TSegment<double>’:
TGeom.cpp:144:   instantiated from here
TGeom.cpp:53: error: invalid use of incomplete type ‘struct IShape<double>’
TGeom.cpp:6: error: declaration of ‘struct IShape<double>’
TGeom.cpp: In instantiation of ‘TPoint<double>’:
TGeom.cpp:54:   instantiated from ‘TSegment<double>’
TGeom.cpp:144:   instantiated from here
TGeom.cpp:13: error: invalid use of incomplete type ‘struct IShape<double>’
TGeom.cpp:6: error: declaration of ‘struct IShape<double>’
TGeom.cpp: In member function ‘bool TCircle<T>::Intersects(const 
TSegment<T>&) const [with T = int]’:
TGeom.cpp:215:   instantiated from here
TGeom.cpp:137: error: ‘sqrt’ was not declared in this scope
TGeom.cpp:215:   instantiated from here
TGeom.cpp:155: error: ‘sqrt’ was not declared in this scope

1. У Вашего класса TPoint можно получить 
значение координат, но нельзя изменить. 
Кстати, T может быть, например, экземпляром 
TBigUInt. Тогда возвращать его по значению 
нерационально. Лучше передавать по ссылке: 
константной или неконстантной (по смыслу).

В остальном все ок. Решение принято.

Минус 20% за сдачу после дедлайна.

Original comment by aivyu...@gmail.com on 28 Apr 2013 at 6:09