Oleksiy
Oleksiy

Reputation: 39810

How to use using for alias?

#include <iostream>
using namespace std;
using uchar = unsigned char;

int main() {
    cin.get();
}

This code results in error: syntax error : missing ';' before '='

How do I fix this (other than using typedef)? Doesn't Visual Studio 2013 support C++11?

Upvotes: 0

Views: 113

Answers (1)

Arne Mertz
Arne Mertz

Reputation: 24596

Visual Studio does not support all of C++11 yet. For specific parts of C++11, you can see Herb Sutter's conformance roadmap for Visual C++. There you can see that using aliases are planned for VS2013 RTM

Until then you will have to resort to the good old typedef

Upvotes: 2

Related Questions