静的関数を持つテンプレート クラスを作成したかった
template <typename T>
class Memory
{
public:
template < typename T>
static <T>* alloc( int dim )
{
T *tmp = new T [ dim ];
return tmp;
};
}
しかし、私はいつも得ます
int *a = Memory::alloc<int>(5)
私は偶然に何を知りません..
»template<class T> class Memory« used without template parameters
expected primary-expression before »int«
Fehler: expected »,« or »;« before »int«