Boost logo

Boost :

From: Assaf Lavie (assaflav_at_[hidden])
Date: 2001-12-10 03:30:46


I've recently started using the boost::any class and I'm wondering about how
to extend it's capabilities.

One thing I missed in the any class was the input and output operators. My
code uses a container of anys and I wanted to stream those anys into
iostream (to save to a file), so I had to go into the any class code and
modify it to add virtual save/load functions to the holder/place_holder
classes.
I was wondering if there's a way of desiging the any class (or any variant
class actually) that will allow additional functions to be added, or invoked
by the class after it is written. Something like the Visitor pattern - but
generic.

I've thought about it all day now and it seems damn near impossible, but as
I'm sure others had thought about it before I'd really like to hear from
anyone who dealt with this topic and can enlighten me.

Assaf Lavie


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