From -5498506505426135620 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,51114e7cf5122752,start X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2001-05-03 13:35:01 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!212.74.64.35!colt.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail From: u477539062@spawnkill.ip-mobilphone.net Newsgroups: comp.std.c++ Subject: Why doesn't auto_ptr define an operator->*() ? Date: Thu, 3 May 2001 20:34:17 GMT Approved: Fergus Henderson , moderator of comp.std.c++ Message-ID: X-Trace: mail2news.demon.co.uk 988922061 mail2news:26435 mail2news mail2news.demon.co.uk X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Lines: 43 Xref: newsfeed.google.com comp.std.c++:4349 I came across a situation recently where I would have liked auto_ptr to define an operator->*(). I was writing a template function object class that should work with any pointer type. The class is similar to std::mem_fun_t except it works with any pointer-like type rather than just plain pointers. When I tried to use the class with auto_ptr I discovered the following: struct foo { void bar(); }; typedef void (foo::*foo_mem_ptr)(); foo_mem_ptr bar_ptr = &foo::bar; foo* foo_ptr = new foo; std::auto_ptr foo_auto_ptr(new foo); (foo_ptr->*bar_ptr)(); // this works (foo_auto_ptr->*bar_ptr)(); // this doesn't So, I did a little research and I found that there was a suggestion on this forum back in 1995 to have operator->*() included in the standard auto_ptr. Does anyone know why it didn't make it? Chris Hines The sooner you start coding, the longer it will take you to finish. -- Sent by chines from comscore in area com This is a spam protected message. Please answer with reference header. Posted via http://www.usenet-replayer.com/cgi/content/new --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.research.att.com/~austern/csc/faq.html ]