Boost logo

Boost Users :

From: Fred Labrosse (ffl_at_[hidden])
Date: 2006-04-20 12:51:49


On Thursday 20 Apr 2006 17:18, John Metta wrote:
> Does Boost have any magic to help with a class method cascade? Consider:
>
> struct INFO
> {
> float mass;
> float volume;
> ...
> virtual void Reset()
> {
> mass = 0.0f;
> volume = 0.0f;
> ...
> };
> }
> struct WATER_INFO : virtual INFO
> {
> float rateInfow;
> float rateOutflow;
> ...
> virtual void Reset()
> {
> rateInflow = 0.0f;
> rateOutflow = 0.0f;
> super.Reset(); // Wish to cascade a reset function down.

What about:

          ::Reset();

At least,

          INFO::Reset();

should work (not very nice, but...). Or am I missing something?

Hope this helps.

Fred

> };
> };
> struct SURFACE_WATER_INFO : virtual INFO
> { ... } // cascading to reset the variables at any level.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net