Boost logo

Boost :

From: Mac Murrett (mmurrett_at_[hidden])
Date: 2002-07-02 23:45:37


I have been looking at the implementations of variant classes
floating by here, and while I have been happy with aspects of them,
I am not happy with the visitability of any of them. I therefore
set out to provide an ideal visitor base class, based on some
previous work of mine: it should be templatized on a type list (no
holy wars on what type of type list, please :) ), should provide an
interface consisting of a visit function for each type in the type
list (that takes a reference to the type), and should have a
pure-virtual back-end. The trick is to have the public interface
be nonvirtual to avoid hidden virtual function problems.

The implementation (with an example) is available at
http://groups.yahoo.com/group/boost/files/visitor.zip. As it uses
type lists, it requires MPL. It has been verified on CW 7.2, CW 8,
and GCC 3.1. It *does not* work won GCC 2.95.2.

Comments appreciated,
Mac Murrett.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk