Re: creating methods for objects

From: David Harmon (source_at_netcom.com.invalid)
Date: 06/18/04


Date: Fri, 18 Jun 2004 19:39:33 GMT

On Fri, 18 Jun 2004 16:31:01 -0300 in comp.lang.c++, André
<andre.NOSPAM@syspoint.com.br> wrote,
>is it possible to override methods for one specific object, like you can
>do in Ruby?

No. You might declare a derived class just for that one object.
You might use a pointer to a function, or some similar low-level
hackery.



Relevant Pages

  • Re: inheritance from C object with different parameter count
    ... > I'm trying to create a derived class (ruby class) from a C-implemented ... def initialize() ... -- define an #initialize method: ...
    (comp.lang.ruby)
  • Re: Named sprintf parameters
    ... a class can override methods in a module it includes, ... reading Russ Olsen's "Design Patterns in Ruby" and he was showing an ... implementation of the Decorator pattern using modules as decorators, ... My blog on Ruby ...
    (comp.lang.ruby)
  • Declaration and Definition
    ... I declare a function that is virutal without implementation code in my base ... the derived class does not implement it so link error occurs. ...
    (microsoft.public.vc.language)
  • Re: strict pragma & scope
    ... >> (note the typo) ... > Ruby requires we declare a local variable before we use it, ... There are no variable declarations in Ruby. ...
    (comp.lang.ruby)
  • Re: Confused with the "virtual base class" concept
    ... I don't know why virtual inheritance removes this, ... overloaded function in derived class ) it hides all ... declare a_methodas virtual, too, don't you? ...
    (comp.lang.cpp)