Просто задал подобный вопрос, который сводится к этому.
#include <iostream>
using namespace std;
struct A {
    A() : a{1} {};
    int a;
};
template <typename Which>
struct WhichType;
int main() {
    const A a;
    const A& a_ref = a;
    const A* a_ptr = &a;
    WhichType<decltype(a.a)> which_obj; // template evaluates to int
    WhichType<decltype(a_ref.a)> which_ref; // template evaluates to int
    WhichType<decltype(a_ptr->a)> which_ptr; // template evaluates to int
    return 0;
}
Почему шаблоны не становятся const int вместо int?
