| 166 | |
| 167 | template <typename Y> |
| 168 | bool _private_less ( |
| 169 | const weak_ptr<Y>& rhs |
| 170 | ) const |
| 171 | { |
| 172 | if (expired()) |
| 173 | { |
| 174 | if (rhs.expired()) |
| 175 | { |
| 176 | return false; |
| 177 | } |
| 178 | else |
| 179 | { |
| 180 | return true; |
| 181 | } |
| 182 | } |
| 183 | else |
| 184 | { |
| 185 | if (rhs.expired()) |
| 186 | { |
| 187 | return false; |
| 188 | } |
| 189 | else |
| 190 | { |
| 191 | // in this case they have both not expired so lets |
| 192 | // compare the shared_node pointers |
| 193 | return (weak_node->shared_node) < (rhs.weak_node->shared_node); |
| 194 | } |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | private: |
| 199 |