[ create a new paste ] login | about

Link: http://codepad.org/HZuCicQl    [ raw code | output | fork ]

C++, pasted on Jun 6:
#include <iostream>
using namespace std;
 
enum eType{
    cTest = 1
};
 
namespace testspace{
    class cTest{
        public:
        int a;
    };
}
 
 
class cData{
    public:
    using cTest = testspace::cTest;
    cTest test;
    void  func(cTest &test);
};

void cData::func(cTest &test){
    test.a = 8;
}
 
int main(){
    cData data;
    data.test.a = 5;
    data.func(data.test);
    cout<<data.test.a<<endl;
    return 0;
}


Output:
1
2
Line 18: error: expected nested-name-specifier before 'cTest'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: