1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
int main(void)
{
TNode first(Vertex(1,1,1)), second(Vertex(2,2,2)), third(Vertex(3,3,3));
TNode fourth = first; // No error here
TNode *fP = &first, *sP = &second, *tP = &third, *lP = &fourth;
std::list<TNode*> l;
l.push_back(fP); l.push_back(sP); l.push_back(tP); l.push_back(lP);
std::ostream_iterator<TNode> out_iter(std::cout, "\n");
//Error here
std::transform(l.begin(), l.end(), out_iter, [](const TNode* p)->TNode{return *p;});
std::copy(l.begin(), l.end(), out_iter);
std::cin.get();
return 0;
}
|