------- Comment #4 from pcayouette at spoluck dot ca 2010-05-31 00:26 ------- Error when #define line uncommented in example attached: In file included from /usr/include/c++/4.4/memory:66, from ../src/TestCpp0x.cpp:1: /usr/include/c++/4.4/bits/shared_ptr.h: In member function bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = std::weak_ptr<int>]: /usr/include/c++/4.4/bits/stl_tree.h:1170: instantiated from std::pair<typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(const _Val&) [with _Key = std::weak_ptr<int>, _Val = std::weak_ptr<int>, _KeyOfValue = std::_Identity<std::weak_ptr<int> >, _Compare = std::less<std::weak_ptr<int> >, _Alloc = std::allocator<std::weak_ptr<int> >] /usr/include/c++/4.4/bits/stl_set.h:411: instantiated from std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename _Alloc::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const _Key&) [with _Key = std::weak_ptr<int>, _Compare = std::less<std::weak_ptr<int> >, _Alloc = std::allocator<std::weak_ptr<int> >] ../src/TestCpp0x.cpp:19: instantiated from here /usr/include/c++/4.4/bits/shared_ptr.h:1466: error: deleted function bool std::weak_ptr<_Tp>::operator<(const std::weak_ptr<_Tp1>&) const [with _Tp1 = int, _Tp = int] /usr/include/c++/4.4/bits/stl_function.h:230: error: used here make: *** [src/TestCpp0x.o] Error 1
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44339