🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Alexandre Oliva Tue, 28 Nov 1995 17:30
Covariance and auto_ptr
#2755
Author: Alexandre Oliva
Date: Tue, 28 Nov 1995 17:30
26 lines
1072 bytes
Is there anything that can be done to allow auto_ptr covariant return
types, that is:

class foo {
 class bar {};
 auto_ptr<bar> getbar() { return new bar(); }
};

class food /* :-) */ : public foo {
 class bard : public foo::bar {};
 auto_ptr<bard> getbar() { return new bard(); }
};

Thanks in advance
-- 
Alexandre Oliva
oliva@dcc.unicamp.br
Departamento de Ci^encia de Computa,c~ao
Universidade Estadual de Campinas
Campinas  S~ao Paulo  Brazil

---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads