Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #80792

Re: dynamic_cast

Path csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c++
Subject Re: dynamic_cast
Date Sat, 07 Aug 2021 13:06:58 -0700
Organization A noiseless patient Spider
Lines 17
Message-ID <86eeb52f4t.fsf@linuxsc.com> (permalink)
References <20210627225136.00005d66@reddwarf.jmc> <sbbr3u$a3j$1@dont-email.me> <sbl7mh$kb5$1@dont-email.me> <sbpm58$tfv$1@dont-email.me> <oMZDI.15364$SA.31@fx39.iad> <sbpq4k$ql6$1@dont-email.me> <j3_DI.7823$en4.873@fx34.iad> <sbpu3o$pkd$1@dont-email.me> <Uz%DI.3582$uM6.29@fx21.iad>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info reader02.eternal-september.org; posting-host="0a1d8104bbc0e7f8706fc1dabce7c8e9"; logging-data="18105"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+8CLf5g/3RnFSFosjv3WQM0kp9zorE3qU="
User-Agent Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock sha1:/MpQ1OWLqafZ6RtSQ3pUcxMYc8A= sha1:vwx4HLg6str+9Qam8qy1Yzp9oAw=
Xref csiph.com comp.lang.c++:80792

Show key headers only | View raw


Richard Damon <Richard@Damon-Family.org> writes:

> On 7/3/21 11:01 AM, Bonita Montero wrote:
>
>>>> If you're doing a dynamic_cast you're switching upon the type of the
>>>> class.  This switching should be better done inside the class with class
>>>> -dependent code - with a virtual function call.
>>>
>>> Wrong.  Application level logic should stay in the application level
>>> code.  That is the only scalable option.
>>
>> Virtual function calls are more scalable.
>
> Wrong, the NUMBER of functions needed grows way to fast to be scalable.

It might, but it doesn't have to.  The number of functions
needed depends on the class hierarchy.

Back to comp.lang.c++ | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

dynamic_cast Mr Flibble <flibble@reddwarf.jmc> - 2021-06-27 22:51 +0100
  Re: dynamic_cast Öö Tiib <ootiib@hot.ee> - 2021-06-27 15:01 -0700
  Re: dynamic_cast Branimir Maksimovic <branimir.maksimovic@gmail.com> - 2021-06-27 22:30 +0000
  Re: dynamic_cast "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-27 16:35 -0700
  Re: dynamic_cast Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-28 08:44 +0200
    Re: dynamic_cast Vir Campestris <vir.campestris@invalid.invalid> - 2021-07-01 21:14 +0100
      Re: dynamic_cast Öö Tiib <ootiib@hot.ee> - 2021-07-01 14:16 -0700
      Re: dynamic_cast red floyd <no.spam.here@its.invalid> - 2021-07-01 17:48 -0700
      Re: dynamic_cast Bonita Montero <Bonita.Montero@gmail.com> - 2021-07-03 14:45 +0200
        Re: dynamic_cast Richard Damon <Richard@Damon-Family.org> - 2021-07-03 09:39 -0400
          Re: dynamic_cast Bonita Montero <Bonita.Montero@gmail.com> - 2021-07-03 15:53 +0200
            Re: dynamic_cast Richard Damon <Richard@Damon-Family.org> - 2021-07-03 09:59 -0400
              Re: dynamic_cast Bonita Montero <Bonita.Montero@gmail.com> - 2021-07-03 17:01 +0200
                Re: dynamic_cast Richard Damon <Richard@Damon-Family.org> - 2021-07-03 11:42 -0400
                Re: dynamic_cast Bonita Montero <Bonita.Montero@gmail.com> - 2021-07-03 18:04 +0200
                Re: dynamic_cast Richard Damon <Richard@Damon-Family.org> - 2021-07-03 13:59 -0400
                Re: dynamic_cast Mr Flibble <flibble@reddwarf.jmc> - 2021-07-03 20:06 +0100
                Re: dynamic_cast Bonita Montero <Bonita.Montero@gmail.com> - 2021-07-04 07:06 +0200
                Re: dynamic_cast Richard Damon <Richard@Damon-Family.org> - 2021-07-03 14:03 -0400
                Re: dynamic_cast Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-08-07 13:06 -0700

csiph-web