Auto formatter changes > > to >>

The name of the pictureThe name of the pictureThe name of the pictureClash 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?










share|improve this question



















  • 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














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?










share|improve this question



















  • 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












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?










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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












  • 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












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






share|improve this answer





























    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.






    share|improve this answer




















      Your Answer





      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      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






























      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






      share|improve this answer


























        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






        share|improve this answer
























          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






          share|improve this answer














          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







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 13 hours ago









          Boann

          36k1286116




          36k1286116










          answered 21 hours ago









          Nishant Singh

          975811




          975811






















              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.






              share|improve this answer
























                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.






                share|improve this answer






















                  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.






                  share|improve this answer












                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 21 hours ago









                  Max Langhof

                  6,1811032




                  6,1811032



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      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













































































                      Comments

                      Popular posts from this blog

                      What does second last employer means? [closed]

                      List of Gilmore Girls characters

                      One-line joke