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


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

Re: Virtual functions: To const, or not to const?

From Muttley@dastardlyhq.com
Newsgroups comp.lang.c++
Subject Re: Virtual functions: To const, or not to const?
Date 2022-10-09 09:19 +0000
Organization Aioe.org NNTP Server
Message-ID <thu3nu$fbl$1@gioia.aioe.org> (permalink)
References <thosit$6fp$1@gioia.aioe.org> <ths1rk$7039$2@dont-email.me> <ad5ab9e6-6982-413e-82f6-dfcbc1b425a3n@googlegroups.com>

Show all headers | View raw


On Sat, 8 Oct 2022 11:03:35 -0700 (PDT)
Michael S <already5chosen@yahoo.com> wrote:
>On Saturday, October 8, 2022 at 5:35:51 PM UTC+3, Bonita Montero wrote:
>> There is no general answer or it depends on what you expect from 
>> this interface. In individual cases, this question is then easy 
>> to answer and therefore I do not know why it has to be discussed.
>
>There is a general answer - don't use inheritance except as substitute
>for interfaces, which typically means abstract classes with no data members.
>All other forms of inheritance are known antipattern.

What a load of nonsense. The java system of extending an interface is next to
useless compared to proper inheritence.

>Use aggregation instead.

I don't think you understand the different use cases of inheritence vs
aggregation.

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


Thread

Virtual functions: To const, or not to const? Juha Nieminen <nospam@thanks.invalid> - 2022-10-07 09:47 +0000
  Re: Virtual functions: To const, or not to const? David Brown <david.brown@hesbynett.no> - 2022-10-07 12:50 +0200
    Re: Virtual functions: To const, or not to const? Juha Nieminen <nospam@thanks.invalid> - 2022-10-10 06:20 +0000
      Re: Virtual functions: To const, or not to const? Richard Damon <Richard@Damon-Family.org> - 2022-10-10 07:38 -0400
        Re: Virtual functions: To const, or not to const? Juha Nieminen <nospam@thanks.invalid> - 2022-10-10 12:08 +0000
          Re: Virtual functions: To const, or not to const? Richard Damon <Richard@Damon-Family.org> - 2022-10-10 20:47 -0400
      Re: Virtual functions: To const, or not to const? Paavo Helde <eesnimi@osa.pri.ee> - 2022-10-10 15:13 +0300
        Re: Virtual functions: To const, or not to const? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-10-10 09:43 -0700
      Re: Virtual functions: To const, or not to const? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-10-10 09:26 -0700
  Re: Virtual functions: To const, or not to const? Paavo Helde <eesnimi@osa.pri.ee> - 2022-10-07 14:00 +0300
  Re: Virtual functions: To const, or not to const? Richard Damon <Richard@Damon-Family.org> - 2022-10-07 07:29 -0400
  Re: Virtual functions: To const, or not to const? Öö Tiib <ootiib@hot.ee> - 2022-10-07 05:55 -0700
  Re: Virtual functions: To const, or not to const? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-10-08 14:56 +0200
  Re: Virtual functions: To const, or not to const? Bonita Montero <Bonita.Montero@gmail.com> - 2022-10-08 16:35 +0200
    Re: Virtual functions: To const, or not to const? Michael S <already5chosen@yahoo.com> - 2022-10-08 11:03 -0700
      Re: Virtual functions: To const, or not to const? Bonita Montero <Bonita.Montero@gmail.com> - 2022-10-08 20:36 +0200
      Re: Virtual functions: To const, or not to const? Mr Flibble <flibble@reddwarf.jmc.corp> - 2022-10-08 20:19 +0100
        Re: Virtual functions: To const, or not to const? Bonita Montero <Bonita.Montero@gmail.com> - 2022-10-10 17:58 +0200
      Re: Virtual functions: To const, or not to const? Muttley@dastardlyhq.com - 2022-10-09 09:19 +0000
  Re: Virtual functions: To const, or not to const? Manfred <noname@add.invalid> - 2022-10-08 21:42 +0200

csiph-web