[computer-go] C++: sstreams

Peter Drake drake at lclark.edu
Wed Aug 9 10:31:02 PDT 2006


I've followed the idiom and overloaded << so that I can print  
instances of my classes to any output stream.  This much works fine:

	BitBoard b;
	b.clear();
	b.add(1);
	ostringstream s;
	s << b;

Now, though, I want to compare s with a different string. The  
compiler won't accept this:

	assert(s == ".....\n.....\n.....\n.....\n.X...\n");

Do I have to do something to convert s into a string?

Peter Drake
Assistant Professor of Computer Science
Lewis & Clark College
http://www.lclark.edu/~drake/




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://computer-go.org/pipermail/computer-go/attachments/20060809/7dd18a45/attachment.htm


More information about the computer-go mailing list