Heikki Levanto wrote:
To get down to earth, I would like to look at the board at the end of
each playout, calculate something more than just win/loss, and pass that
info back to who ever called playout. One way to do that would be to
pass a function pointer and a (void?) pointer to playout, and have it
call back the function with the board, winner, and the void pointer. If
that sounds more like C than C++, it is because I am a C programmer. If
some other C++ idiom could do the same thing, all the better.
If you're going for more of a C++ library feel, function objects are the way to go. Function objects impose extra overhead but add a potential for a more generic adapter around other code that uses it. I have yet to convince myself of the benefit of C++ function objects for most applications. C++'s support for them is just too clunky in comparison to other C++ language features (or equivalent ones in other languages with built-in support).
_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to