vendredi 20 juillet 2018

Implementation of std::remove_reference

here is part of implementation std::remove_reference:

struct remove_reference { typedef T type};

So, I can’t get how this part of code typedef T type remove a reference from T. I know that typedef make a type alias for type like atypedef int integer, so now integer is type alias for int, and I can declare some int variable like this integer a = 5; , but I don’t get real purpose of typedef in implementation of std::remove_reference, please, help me find a solution.

Aucun commentaire:

Enregistrer un commentaire