[computer-go] C++ parameter passing
Darren Cook
darren at dcook.org
Wed Aug 9 15:46:36 PDT 2006
> I'd like to pass a large array by constant reference. I tried this:
>
> void remove_from_zobrist_hash(BoardState & state, color_t color, const
> uint64_t & zobrist_numbers[][])
Taking a step back, zobrist_numbers[][] could be a private member in a
class, and remove() could be a function on that class.
...actually I guess this is a member function of a class to store a
zobrist hash? In that case zobrist_numbers should be a static data
member of that class shouldn't it?
Anyway, whatever, in the terms of Martin Fowler's Refactoring book,
passing a multidimensional array as a parameter to a function is a
"smell" and you should refactor.
Darren
More information about the computer-go
mailing list