Visual Studio Code - C++ auto formatter changes > > to >>
Clash Royale CLAN TAG#URR8PPP
up vote
7
down vote
favorite
I'm having a problem with the C++ extension of VScode. Whenever I define a matrix consisting of vectors like vector<vector<int> >
and use the auto formatter, it changes the code to vector<vector<int>>
which results in a compiler error.
Is there any solution to this?
c++ visual-studio-code vscode-settings vscode-extensions autoformatting
add a comment |Â
up vote
7
down vote
favorite
I'm having a problem with the C++ extension of VScode. Whenever I define a matrix consisting of vectors like vector<vector<int> >
and use the auto formatter, it changes the code to vector<vector<int>>
which results in a compiler error.
Is there any solution to this?
c++ visual-studio-code vscode-settings vscode-extensions autoformatting
4
That sounds like you are using a really old compiler version where that parsing issue is not resolved by the language yet... Is upgrading to a newer compiler an option?
– Max Langhof
1 hour ago
1
You'd be hard-pressed to find a compiler that doesn't support this in C++11 mode. @Erebos Try adding-std=c++11
to the compiler flags.
– rubenvb
1 hour ago
add a comment |Â
up vote
7
down vote
favorite
up vote
7
down vote
favorite
I'm having a problem with the C++ extension of VScode. Whenever I define a matrix consisting of vectors like vector<vector<int> >
and use the auto formatter, it changes the code to vector<vector<int>>
which results in a compiler error.
Is there any solution to this?
c++ visual-studio-code vscode-settings vscode-extensions autoformatting
I'm having a problem with the C++ extension of VScode. Whenever I define a matrix consisting of vectors like vector<vector<int> >
and use the auto formatter, it changes the code to vector<vector<int>>
which results in a compiler error.
Is there any solution to this?
c++ visual-studio-code vscode-settings vscode-extensions autoformatting
c++ visual-studio-code vscode-settings vscode-extensions autoformatting
asked 1 hour ago
ErebosM
931112
931112
4
That sounds like you are using a really old compiler version where that parsing issue is not resolved by the language yet... Is upgrading to a newer compiler an option?
– Max Langhof
1 hour ago
1
You'd be hard-pressed to find a compiler that doesn't support this in C++11 mode. @Erebos Try adding-std=c++11
to the compiler flags.
– rubenvb
1 hour ago
add a comment |Â
4
That sounds like you are using a really old compiler version where that parsing issue is not resolved by the language yet... Is upgrading to a newer compiler an option?
– Max Langhof
1 hour ago
1
You'd be hard-pressed to find a compiler that doesn't support this in C++11 mode. @Erebos Try adding-std=c++11
to the compiler flags.
– rubenvb
1 hour ago
4
4
That sounds like you are using a really old compiler version where that parsing issue is not resolved by the language yet... Is upgrading to a newer compiler an option?
– Max Langhof
1 hour ago
That sounds like you are using a really old compiler version where that parsing issue is not resolved by the language yet... Is upgrading to a newer compiler an option?
– Max Langhof
1 hour ago
1
1
You'd be hard-pressed to find a compiler that doesn't support this in C++11 mode. @Erebos Try adding
-std=c++11
to the compiler flags.– rubenvb
1 hour ago
You'd be hard-pressed to find a compiler that doesn't support this in C++11 mode. @Erebos Try adding
-std=c++11
to the compiler flags.– rubenvb
1 hour ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
6
down vote
VSCode C++ extension uses clang-format for formatting the document. If you are stuck with old compiler which doesn't supports C++ 11, just add a .clang-format file in your workspace with following line
Standard : Cpp03
For more formatting options, refer to following link
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
add a comment |Â
up vote
3
down vote
The compiler error is that >>
is interpreted as the right shift operator instead of two consecutive template argument list delimiters. Before C++11 this was how the language required the parser to work. However, in C++11, an exception was added to prevent this. See this answer for more information.
The best solution would be to upgrade your compiler to C++11 or later.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
VSCode C++ extension uses clang-format for formatting the document. If you are stuck with old compiler which doesn't supports C++ 11, just add a .clang-format file in your workspace with following line
Standard : Cpp03
For more formatting options, refer to following link
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
add a comment |Â
up vote
6
down vote
VSCode C++ extension uses clang-format for formatting the document. If you are stuck with old compiler which doesn't supports C++ 11, just add a .clang-format file in your workspace with following line
Standard : Cpp03
For more formatting options, refer to following link
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
add a comment |Â
up vote
6
down vote
up vote
6
down vote
VSCode C++ extension uses clang-format for formatting the document. If you are stuck with old compiler which doesn't supports C++ 11, just add a .clang-format file in your workspace with following line
Standard : Cpp03
For more formatting options, refer to following link
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
VSCode C++ extension uses clang-format for formatting the document. If you are stuck with old compiler which doesn't supports C++ 11, just add a .clang-format file in your workspace with following line
Standard : Cpp03
For more formatting options, refer to following link
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
answered 1 hour ago
Nishant Singh
77369
77369
add a comment |Â
add a comment |Â
up vote
3
down vote
The compiler error is that >>
is interpreted as the right shift operator instead of two consecutive template argument list delimiters. Before C++11 this was how the language required the parser to work. However, in C++11, an exception was added to prevent this. See this answer for more information.
The best solution would be to upgrade your compiler to C++11 or later.
add a comment |Â
up vote
3
down vote
The compiler error is that >>
is interpreted as the right shift operator instead of two consecutive template argument list delimiters. Before C++11 this was how the language required the parser to work. However, in C++11, an exception was added to prevent this. See this answer for more information.
The best solution would be to upgrade your compiler to C++11 or later.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
The compiler error is that >>
is interpreted as the right shift operator instead of two consecutive template argument list delimiters. Before C++11 this was how the language required the parser to work. However, in C++11, an exception was added to prevent this. See this answer for more information.
The best solution would be to upgrade your compiler to C++11 or later.
The compiler error is that >>
is interpreted as the right shift operator instead of two consecutive template argument list delimiters. Before C++11 this was how the language required the parser to work. However, in C++11, an exception was added to prevent this. See this answer for more information.
The best solution would be to upgrade your compiler to C++11 or later.
answered 1 hour ago


Max Langhof
5,921931
5,921931
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52928581%2fvisual-studio-code-c-auto-formatter-changes-to%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
4
That sounds like you are using a really old compiler version where that parsing issue is not resolved by the language yet... Is upgrading to a newer compiler an option?
– Max Langhof
1 hour ago
1
You'd be hard-pressed to find a compiler that doesn't support this in C++11 mode. @Erebos Try adding
-std=c++11
to the compiler flags.– rubenvb
1 hour ago