vendredi 27 mai 2016

How to set a prefix for std::ostream_iterator?

I would like to do something like this:

std::ofstream ch("ch_out.txt");
std::ostream_iterator< cgal_class >  out( "p ", ch, "\n" );

Is this even possible? I worry because my research says no, hope it was broken. :)


The goal is to take the convex hull points produced by CGAL and write them in a file like this:

p 2 0
p 0 0
p 5 4

with this code:

std::ofstream ch("ch_out.txt");
std::ostream_iterator< Point_2 >  out( "p ", ch, "\n" );
CGAL::ch_graham_andrew( in_start, in_end, out );

and the problem is that I do not want/can touch the CGAL function.

Aucun commentaire:

Enregistrer un commentaire