Older blog entries for lerdsuwa (starting at number 55)

The patch member class as template friend is finished and posted. I ended up using typename for both code cases mentioned in the previous diary:

template <class T> class C {
  friend class D<T>::X;
  template <class U> friend class D<U>::Y;
};
I used the fact that, after instantiation of C such as C<int>, the first one become template-parameter non-dependent while the other still depends on the template parameter U.
GCC

After some experiment, using typename for internal representation is not enough. It cannot distinguish between the following two cases:

template <class T> struct D { ... };
template <class T> class C {
  friend class D<T>::X;                    // use typename here?
  template <class U> friend class D<U>::Y; // also use typename?
};
My latest idea is to invent a new tree node to represent the second friend.

I find myself reviewing yet another C++ book. This time it's a new edition, not a new book. So it's already in a good shape and doesn't need much comment. This makes my work a lot easier.

For GCC, I just get back to member class as template friend feature as in code like

class C {
  template <class T> friend class A<T>::X;
}
One more step is accomplished: checking class-key syntax error for codes like

template <class T> class C {
  friend typename T::X;     // Syntax error
  friend typename T::X f(); // OK
};
is moved to parser. The new friend feature requires the same internal representation as 'typename' so the diagnostics of such error cannot be performed in later stages. Next step: making friend codes able to handle the typename representation.

Back to GCC hacking. The patch for bug 13092 is finally accepted and committed to the mainline.

I work on member class as template friend feature to compliment the work earlier on member function. It can deal with simpler cases now, but some more thought is necessary for advanced cases. May be a few week to go before a patch is ready.

As a break, I look at a few template template parameter bugs reported. Fixing them is not as hard as the template friend feature above and take only a day or two each. In fact one is fixed already and I am testing a patch for the next one.

Reviewing the C++ book is eating all my time. After it's finished, which should be very soon, then it's time to go back to GCC hacking. A new development version of kcd will be out too.

GRhino
It turned out that the hashing used in GRhino failed to take into account two problems:

  • The board score depends on who has the next move. The comes from the parity evaluator.
  • The range of score computed may be limited due to alpha-beta pruning and it not accurate when reused during evaluation of next moves.
Both are fixed and the result is GRhino 0.12.0. Verifying that the search algorithm runs correctly will be dealt with some time later. Next version will have game save/load features and may be timed game if I can finalize on the layout of the clocks on the board window.

Figured out what to do next with GRhino - fixing the AI :) After playing with alpha-beta pruning and end game searching tests, it turned out that incorrect hashing is the source of AI weakness. The hash-disabled GRhino beats the latest GRhino release version all the time. The next part is to find out why the hash is corrupt, which is again not easy.

Finished the move history, online help and random board features in GRhino. I am still deciding which feature is the next one to be added. The AI still has weakness but dealing with it now requires a lot of infrastructure code and I am lazy now :)

Finished another feature of GRhino - move history window and ability to go back and forth at any point in game history. It uses GtkTreeView, rather that GtkCList which I am familiar with, which takes quite time to figure out. It has pretty much everything I planned, except the ability to calculate the size of history window automatically. The size is currently hard-coded. It should remains this way as I don't want to learn Pango stuffs yet.

A lot of things happen lately. Toolbar feature in GRhino was done and GRhino 0.10.0 was out. Someone (bug report filed anonymously) also discovered problems with kcd so two versions of kcd were released there as well. On C++ side, I got an invitation to be a reviewer for a C++ book, hmm...

46 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!