一个小时后出发# Environmental - 环境科学与工程
j*i
1 楼
Trying to write a class with an Iterator member class with template. The
begin(), end(), and << operator reports syntax error. How should I write
these functions correctly? A little confused about how template and member
class work together. Somebody help.
Thanks.
MyVector.h:
#ifndef MYVECTOR_H_
#define MYVECTOR_H_
#include
using namespace std;
template
class MyVector
{
public:
MyVector();
virtual ~MyVector();
void add(const T& t);
class Iterator
{
begin(), end(), and << operator reports syntax error. How should I write
these functions correctly? A little confused about how template and member
class work together. Somebody help.
Thanks.
MyVector.h:
#ifndef MYVECTOR_H_
#define MYVECTOR_H_
#include
using namespace std;
template
class MyVector
{
public:
MyVector();
virtual ~MyVector();
void add(const T& t);
class Iterator
{