エラーC2955: 'math :: Array':テンプレートテンプレートの使用にテンプレート引数リストが必要です。テンプレートでエラーが発生しました "テンプレート引数リストが必要です"
Array.h
#ifndef _ARRAY_
#define _ARRAY_
namespace math
{
template <typename T>
class Array
{
protected:
//! Flat storage of the elements of the array of type T
T * buffer;
unsigned int width, height;
public:
Array & operator = (const Array<T> & source);
};
} // namespace math
#include "Array.hpp"
#endif
Array.hpp
#ifndef _ARRAY_IMPLEMENTATION_
#define _ARRAY_IMPLEMENTATION_
namespace math
{
template<typename T>
Array & Array <T>::operator = (const Array<T>& source)
{
int size = 3 * getWidth() * getHeight();
Array<T> buffer = new Vec3<T>[size];
return *buffer;
}
} // namespace math
#endif
投稿する[mcve]してください。文脈は重要です。 – Angew
戻り値は 'Array&' –
'Array&Array 'でなければなりません。 :: operator =' ... *最初の* 'Array'はどうなっていますか? –