How can I compare two std::reference_wrapper
s by the references they hold? I want to see if the references of two std::reference_wrapper
s are equal or not.
Edit: Sorry from confusion. I meant how to get the addresses of referents and compare them.
The get()
member function returns a reference to the element referred to. You can then take the addresses of the referents directly.
std::addressof(r1.get()) == std::addressof(r2.get())