[C++-sig] Polymorphism and Dangling Reference exception

David Abrahams dave at boost-consulting.com
Wed May 24 14:09:33 CEST 2006


David Abrahams <dave at boost-consulting.com> writes:

> "Garrick Chin" <nonexistent.ftp at gmail.com> writes:
>
>> ReferenceError: Attempt to return dangling reference to object of
>> type: class std::basic_string<char,struct std::char_traits<char>,class
>> std::allocator<char> >
>>
>> I do not understand why this would be thrown.  
>
> Me neither.  What is your compiler and platform, please?

FWIW, the enclosed works for me:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: quack.py
Type: text/x-python
Size: 342 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20060524/b7951d45/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quack.cpp
Type: text/x-cpp
Size: 782 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20060524/b7951d45/attachment.bin>
-------------- next part --------------

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com


More information about the Cplusplus-sig mailing list