lundi 28 septembre 2015

Possible implementations of std::ignore

I tried searching for possible implementations of std::ignore, but failed to find a clear answer.

http://ift.tt/1LX4Rqv cites problems with c++ spec and provides and illustrative implementation as

namespace std {

struct _Ignore
{
    template <class _Type>
    _Ignore& operator= (const _Type& value) { return *this; }
};

const _Ignore ignore = _Ignore ();

} // namespace std

And there are further discussions about the problems. So, how the current implementations looks like? and why?

Aucun commentaire:

Enregistrer un commentaire