我的代码;
template<typename T, int N>
class ngon{
point<T> vertices[N];
...
template<typename O> ngon<T,N>& operator=(const ngon<O,N> otyp);
// O stands for other, as in other type
...
};
...
template<typename T, int N> typename<typename O>
ngon<T,N>& operator=(const ngon<O,N> otyp){
for (int i = 0; i < N; i++)
vertices[i] = point<T>(otyp.vertices[i]);
return this;
}
.\Libraries/.\Geometry\Polygon_D2.hpp:103:11: error: too many template-parameter-lists
ngon<T,N>& operator=(const ngon<O,N> otyp){
最佳答案
采用
ngon<T,N> ngon<T,N>::operator=(const ngon<O,N> otyp){
ngon<T,N> operator=(const ngon<O,N> otyp){
https://stackoverflow.com/questions/31094812/