cxx: Add support for operator == with objects

This commit is contained in:
Jean-Philippe Andre 2017-11-06 12:26:05 +09:00
parent d4c92b39df
commit 64698daeb5
1 changed files with 12 additions and 0 deletions

View File

@ -135,6 +135,18 @@ struct wref
}
#endif
template <typename U>
bool operator == (U const &other) const
{
return other._eo_ptr() == _eo_wref;
}
template <typename U>
friend bool operator == (U const &other, wref<T> const &thiz)
{
return other._eo_ptr() == thiz._eo_wref;
}
private:
void _add()
{