Re: C++ question. Is this safe?

2005-02-20 Thread Asger Ottar Alstrup
Andre Poenitz wrote: I am not sure the message is valid. Sure, the compiler sees a tmporary and returning a reference to a part of something refered to by the temporary. However, that thing is not a temporary but lives in a structure outside. The compiler does not know, but we do. So my guess is

Re: C++ question. Is this safe?

2005-02-20 Thread Asger Ottar Alstrup
Andre Poenitz wrote: I am not sure the message is valid. Sure, the compiler sees a tmporary and returning a reference to a part of something refered to by the temporary. However, that thing is not a temporary but lives in a structure outside. The compiler does not know, but we do. So my guess is

Re: C++ question. Is this safe?

2005-02-19 Thread Andre Poenitz
On Tue, Feb 15, 2005 at 10:58:13AM +, Angus Leeming wrote: class Mover {...}; class SpecialisedMover : public Mover {...}; class Movers { public: /// @c returns the Mover registered for format @c fmt. Mover const operator()(std::string const fmt) const {

Re: C++ question. Is this safe?

2005-02-19 Thread Andre Poenitz
On Tue, Feb 15, 2005 at 10:58:13AM +, Angus Leeming wrote: > class Mover {...}; > class SpecialisedMover : public Mover {...}; > > class Movers { > public: > /// @c returns the Mover registered for format @c fmt. > Mover const & operator()(std::string const & fmt) const > { >

Re: C++ question. Is this safe?

2005-02-15 Thread Lars Gullik Bjønnes
Angus Leeming [EMAIL PROTECTED] writes: | class Mover {...}; | class SpecialisedMover : public Mover {...}; | class Movers { | public: | /// @c returns the Mover registered for format @c fmt. | Mover const operator()(std::string const fmt) const | { |

Re: C++ question. Is this safe?

2005-02-15 Thread Angus Leeming
Lars Gullik Bjønnes wrote: Angus Leeming [EMAIL PROTECTED] writes: | class Mover {...}; | class SpecialisedMover : public Mover {...}; | class Movers { | public: | /// @c returns the Mover registered for format @c fmt. | Mover const operator()(std::string const fmt) const |

Re: C++ question. Is this safe?

2005-02-15 Thread Asger Alstrup
Angus Leeming wrote: That will require an MSVC user (Asger) to check his std::map::const_iterator implementation. I'm not sure this is what you are looking for, but here is some of the code for the map::const_iterator in MSVC 7.1: class const_iterator : public

Re: C++ question. Is this safe?

2005-02-15 Thread Angus Leeming
Asger Alstrup wrote: Angus Leeming wrote: That will require an MSVC user (Asger) to check his std::map::const_iterator implementation. I'm not sure this is what you are looking for, but here is some of the code for the map::const_iterator in MSVC 7.1: class const_iterator : public

Re: C++ question. Is this safe?

2005-02-15 Thread Asger Alstrup
Angus Leeming wrote: I read that as saying that the code in the mail at the start of this thread is perfectly safe, don't you? Well, we also have: templateclass _Traits class _Tree { const_iterator find(const key_type _Keyval) const { // find an element in

Re: C++ question. Is this safe?

2005-02-15 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes: | class Mover {...}; | class SpecialisedMover : public Mover {...}; > | class Movers { | public: | /// @c returns the Mover registered for format @c fmt. | Mover const & operator()(std::string const & fmt) const | { |

Re: C++ question. Is this safe?

2005-02-15 Thread Angus Leeming
Lars Gullik Bjønnes wrote: > Angus Leeming <[EMAIL PROTECTED]> writes: > > | class Mover {...}; > | class SpecialisedMover : public Mover {...}; >> > | class Movers { > | public: > | /// @c returns the Mover registered for format @c fmt. > | Mover const & operator()(std::string const &

Re: C++ question. Is this safe?

2005-02-15 Thread Asger Alstrup
Angus Leeming wrote: That will require an MSVC user (Asger) to check his std::map::const_iterator implementation. I'm not sure this is what you are looking for, but here is some of the code for the map::const_iterator in MSVC 7.1: class const_iterator : public

Re: C++ question. Is this safe?

2005-02-15 Thread Angus Leeming
Asger Alstrup wrote: > Angus Leeming wrote: >> That will require an MSVC user (Asger) to check his >> std::map::const_iterator implementation. > > I'm not sure this is what you are looking for, but here is some of the > code for the map::const_iterator in MSVC 7.1: > > class const_iterator > :

Re: C++ question. Is this safe?

2005-02-15 Thread Asger Alstrup
Angus Leeming wrote: I read that as saying that the code in the mail at the start of this thread is perfectly safe, don't you? Well, we also have: template class _Tree { const_iterator find(const key_type& _Keyval) const { // find an element in nonmutable