this keyword in initilizer for ambiguity resolution

Viewed 73

I came across the way to initialize member data with parameter having the same name as:

class T {
    int x;
public:
    T(int x) : x(x) {}   // assign parameter x to T::x
};

It worked fine. But when I'd tried to explicitly initialize using this keyword, error occurred.

    T(int x) : this->x (x) {}   // error

Could anybody explain the cause of the error?

3 Answers
Related