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


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

Re: Simple inheritance-template question

From "crea" <no@invalid.com>
Newsgroups comp.lang.c++
References (2 earlier) <_Lzpp.51518$7u3.30656@newsfe04.ams2> <3ba65432-9aa1-4c9c-8326-59496b82f3e0@p3g2000vbv.googlegroups.com> <XKApp.8510$bI3.5478@newsfe15.ams2> <600280e3-4c70-4492-a876-a305db5e4799@n2g2000prj.googlegroups.com> <dVBpp.546$IK1.368@newsfe10.ams2>
Subject Re: Simple inheritance-template question
Message-ID <t2Cpp.4194$Pi.987@newsfe22.ams2> (permalink)
Organization virginmedia.com
Date 2011-04-14 13:48 +0100

Show all headers | View raw


"crea" <no@invalid.com> wrote in message 
news:dVBpp.546$IK1.368@newsfe10.ams2...
>
> virtual BBData NewObject()
>
> { return new BBData(); }
>

Only problem I see here is that the class derived from AA now has to 
remember to create the NewObject fucntion. I they dont, it will fail. Is 
there any way to force the child class to create always this NewObject 
function, otherwise there is compile error? If not, there is a human error 
possibility here if forgets to implement NewObject function in child 
classes. 

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


Thread

Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 10:26 +0100
  Re: Simple inheritance-template question Ian Collins <ian-news@hotmail.com> - 2011-04-14 21:51 +1200
    Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 11:12 +0100
      Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 11:29 +0100
      Re: Simple inheritance-template question Goran <goran.pusic@gmail.com> - 2011-04-14 03:56 -0700
        Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 12:19 +0100
          Re: Simple inheritance-template question Goran <goran.pusic@gmail.com> - 2011-04-14 04:58 -0700
            Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 13:25 +0100
            Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 13:38 +0100
              Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 13:48 +0100
                Re: Simple inheritance-template question Goran <goran.pusic@gmail.com> - 2011-04-14 06:06 -0700
    One template solution I know, but... "crea" <no@invalid.com> - 2011-04-14 11:41 +0100
      Re: One template solution I know, but... Victor Bazarov <v.bazarov@comcast.invalid> - 2011-04-14 09:32 -0400
        Re: One template solution I know, but... "crea" <no@invalid.com> - 2011-04-14 15:19 +0100
  Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 10:59 +0100
    Re: Simple inheritance-template question Noah Roberts <dont@email.me> - 2011-04-14 09:29 -0700
      Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-15 07:50 +0100
      Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-17 17:22 +0100

csiph-web