Becher, Jochen wrote:
thank you, you are right, remove_reference fixes the problem. I do not understand why MSVC print the reference type without the reference symbol (I checked this twice) but internally it seems to be a reference type (and that is what you expect for typedef ...::reference).
I don't know, what you mean with "MSVC print the reference type". Do you mean the debugger view, the result of typeid(your_type).name()? The standard clearly says that typeid(some_type) == typeid(some_type&), see [expr.typeid]/4: "[..] If the type of the type-id is a reference type, the result of the typeid expression refers to a type_info object representing the referenced type [..] " So, it's more than reasonable that any debugger view will use a similar logic.
It should evaluate to the true type because ...::reference is
const std::pair
Nope, wouldn't that be:
const std::pair
& which is a reference type and can be neither const nor volatile qualified (the const qualifier in the above refers to the thing being referenced not the reference itself). If you feed it through remove_reference before passing to is_const then you should get true as the result.
IMO John meant the reference type, otherwise his message would not make much sense. Greetings from Bremen, Daniel Krügler