/*****************************************************************
Name :
Date : 2017/04/04
By : CharlotteHonG
Final: 2017/04/04
*****************************************************************/
#include <iostream>
using namespace std;
class A {
public:
A(int i=1): num(i){}
int num;
};
class B : public A{
public:
decltype(num) & alias = num;
// auto & newnum = num; //error
B(): A(2){
cout << "num=" << alias << endl;
}
};
//================================================================
int main(int argc, char const *argv[]){
B a;
return 0;
}
//================================================================
LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCk5hbWUgOiAKRGF0ZSA6IDIwMTcvMDQvMDQKQnkgICA6IENoYXJsb3R0ZUhvbkcKRmluYWw6IDIwMTcvMDQvMDQKKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiNpbmNsdWRlIDxpb3N0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIEEgewpwdWJsaWM6CiAgICBBKGludCBpPTEpOiBudW0oaSl7fQogICAgaW50IG51bTsKfTsKCmNsYXNzIEIgOiBwdWJsaWMgQXsKcHVibGljOgogICAgZGVjbHR5cGUobnVtKSAmIGFsaWFzID0gbnVtOwogICAgLy8gYXV0byAmIG5ld251bSA9IG51bTsgLy9lcnJvcgogICAgQigpOiBBKDIpewogICAgICAgIGNvdXQgPDwgIm51bT0iIDw8IGFsaWFzIDw8IGVuZGw7CiAgICB9Cn07Ci8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQppbnQgbWFpbihpbnQgYXJnYywgY2hhciBjb25zdCAqYXJndltdKXsKICAgIEIgYTsKICAgIHJldHVybiAwOwp9Ci8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ==