Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-3547

Template argument lists should end with ">>"

    XMLWordPrintable

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Remove the space between the two right angle brackets.
    • Highlighting:
      Hide

      space(s)

      Show
      space(s)
    • Default Severity:
      Minor
    • Impact:
      Low
    • Likelihood:
      Low
    • Targeted languages:
      C++
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      1min

      Description

      C++11 improves the specification of the parser so that at the end of a template, multiple {{>}}s will be interpreted as closing the template argument list rather than as the right shift operator or stream extraction operator. It is no longer required to place a space between the two {{>}}s.

      This rule raises an issue when such useless spaces exist.

      Noncompliant Code Example

      vector<pair<int,int> > s; // Noncompliant
      

      Compliant Solution

      vector<pair<int,int>> s;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              alban.auzeill Alban Auzeill
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: