The standard has no requirements on the type of ignore
, besides the fact that it is a type that is distinct from all other types.
Whatever machinery that a standard library container does to allow ignore
to gain the required behavior when used with tie
is up to that standard library implementation. The library may give it a template<T&> operator=(const T&)
overload, or it may use some other mechanism to make it work. The standard doesn't say. So it doesn't even have to be CopyAssignable
.
Note that tie
only has special behavior if you specifically use ignore
. If you use some other value, created by yourself (which, since the type has no requirements, you are not guaranteed to be able to do), you will get undefined behavior.