Nie. Nie używasz do takich rzeczy ani #define ani typedef.
Dla C++11 (bo poniżej nie ma co schodzić):
#include <iostream>
#include <type_traits>
#include <vector>
#include <list>
// "Klasa pretekst" do prezentacji.
struct X {
std::vector<double> my_vector;
};
// ...
struct Y {
std::list<float> my_list;
};
int main() {
// typedef nie jest obecnie polecany.
// Oto wykonanie aliasu typu na element w klasie
using data_type = decltype(X::my_vector);
// Tu użycie typu...
data_type vec;
// Tutaj test czy do spodziewany typ
std::cout << "data_type is a std::vector<double> ? "
<< std::boolalpha
<< std::is_same<std::vector<double>, data_type>::value << '\n';
// Ten sam przypadek przy obiekcie. Tym razem dla Y.
Y y;
auto ptr_y = &y;
using y_member_type = decltype(ptr_y->my_list);
y_member_type other_data;
std::cout << "y_member_type is a std::list<float> ? "
<< std::boolalpha
<< std::is_same<std::list<float>, y_member_type>::value << '\n';
}