Data dispatching using dynamic_cast. How to avoid it?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • D. Susman

    #1

    Data dispatching using dynamic_cast. How to avoid it?

    Hi,

    I am working on a data centric project. I have a Process function that
    will be called by some thread. The signature goes:

    void Process( Base* base )
    {
    }

    There are hundred possibilities on what "base" actually (i.e. actual
    run-time type) is. I would like to avoid the bulky if statements to
    handle the downcasts. Is there a common approach/idiom to handle that?

    Thank you.
Working...