Auto formatter changes > > to >>
Clash Royale CLAN TAG#URR8PPP
up vote
18
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 autoformatting
add a comment |Â
up vote
18
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 autoformatting
26
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
21 hours ago
13
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
21 hours ago
add a comment |Â
up vote
18
down vote
favorite
up vote
18
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 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 autoformatting
c++ visual-studio-code vscode-settings autoformatting
edited 22 mins ago
Micha Wiedenmann
9,3751064102
9,3751064102
asked 21 hours ago
ErebosM
1511114
1511114
26
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
21 hours ago
13
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
21 hours ago
add a comment |Â
26
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
21 hours ago
13
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
21 hours ago
26
26
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
21 hours 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
21 hours ago
13
13
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
21 hours 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
21 hours ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
38
down vote
The VSCode C++ extension uses clang-format for formatting the document. If you are stuck with an old compiler which doesn't support C++11, just add a .clang-format file in your workspace with following line:
Standard : Cpp03
For more formatting options, refer to the following link:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
add a comment |Â
up vote
26
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
38
down vote
The VSCode C++ extension uses clang-format for formatting the document. If you are stuck with an old compiler which doesn't support C++11, just add a .clang-format file in your workspace with following line:
Standard : Cpp03
For more formatting options, refer to the following link:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
add a comment |Â
up vote
38
down vote
The VSCode C++ extension uses clang-format for formatting the document. If you are stuck with an old compiler which doesn't support C++11, just add a .clang-format file in your workspace with following line:
Standard : Cpp03
For more formatting options, refer to the following link:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
add a comment |Â
up vote
38
down vote
up vote
38
down vote
The VSCode C++ extension uses clang-format for formatting the document. If you are stuck with an old compiler which doesn't support C++11, just add a .clang-format file in your workspace with following line:
Standard : Cpp03
For more formatting options, refer to the following link:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
The VSCode C++ extension uses clang-format for formatting the document. If you are stuck with an old compiler which doesn't support C++11, just add a .clang-format file in your workspace with following line:
Standard : Cpp03
For more formatting options, refer to the following link:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
edited 13 hours ago


Boann
36k1286116
36k1286116
answered 21 hours ago
Nishant Singh
975811
975811
add a comment |Â
add a comment |Â
up vote
26
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
26
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
26
down vote
up vote
26
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 21 hours ago


Max Langhof
6,1811032
6,1811032
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%2fauto-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
26
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
21 hours ago
13
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
21 hours ago