vector and algorithm
#include
#include
#include
using namespace std;
template ostream & print(const T & start, const T & end)
{
T tmp = start;
for(; tmp != end; ++tmp)
{
cout<< *tmp<< " ";
}
return cout;
}
class A
{
public:
int a;
public:
A(int a):a(a) {}
};
ostream & operator<<(ostream & c, const A & o)
{
c< & v)
{
for(unsigned i = 0; i < size; ++i)
{
v.push_back(new A(table[i])); //LINE I
}
}
void del(A * p)
{
delete p;
}
int main()
{
int tab[]={1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
vector v1;
fill(tab, 10, v1);
print(v1.rbegin(), v1.rend())<
|