C++0xのdecltypeでこれできるかな

decltypeの解説はこちら



メタ関数にインスタンスを渡したい

int *p;
is_pointer<decltype(p)>::value;

ConceptGCCではOK




インスタンスからメンバの型を取得したい

vector<int> v;
decltype(v)::iterator it = v.begin();
map<string, int> m;
for (decltype(m)::value_type value : m)
  cout << value.first << "," << value.second << endl;

ConceptGCCではNG




N2343 - Decltype (revision 7): proposed wording