How to check if two iterators are equal?
===

Say I'm making a function to copy a value:

	template<class It>
	void copy(It i, It o) { *o = *i; }

and I would like to **avoid the copy** if `input` and `output` are the same, since then the copy is pointless.

Obviously, I can't say `if (i != o) { ... }`; less obviously, I can't use overloaded templated functions either, because the iterators might belong to different containers even though they have the same type.

My initial solution to this was:

	template<class It>
	void copy(It i, It o) { if (&*o != static_cast<void const *>(&*i)) { *o = *i; } }

but I'm not sure if this works. What if `*o` or `*i` actually returns an object instead of a reference?

Is there a way to do this generically?