Variable: c-or-c++-mode--regexp

c-or-c++-mode--regexp is a variable defined in cc-mode.el.gz.

Value

"^[     ]*\\(?:using[   ]+\\(?:namespace[       ]+\\|[a-zA-Z_][a-zA-Z0-9_]*::\\|[a-zA-Z_][a-zA-Z0-9_]*[         ]*=\\)\\|\\(?:inline[   ]+\\)?namespace\\(?:[   ]+\\(?:[a-zA-Z_][a-zA-Z0-9_]*::\\)*[a-zA-Z_][a-zA-Z0-9_]*\\)?[  ]*{\\|class[    ]+[a-zA-Z_][a-zA-Z0-9_]*\\(?:[  ]+final\\)?[    ]*[:{;\n]\\|struct[     ]+[a-zA-Z_][a-zA-Z0-9_]*\\(?:[  ]+final[        ]*[:{\n]\\|[    ]*:\\)\\|template[      ]*<.*?>\\|#include[       ]*<\\(?:iostream\\|map\\|s\\(?:et\\|tring\\(?:_view\\)?\\)\\|tuple\\|unordered_\\(?:map\\|set\\)\\|vector\\)>\\)"

Documentation

A regexp applied to C header files to check if they are really C++.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-mode.el.gz
(defconst c-or-c++-mode--regexp
  (eval-when-compile
    (let ((id "[a-zA-Z_][a-zA-Z0-9_]*") (ws "[ \t]+") (ws-maybe "[ \t]*")
          (headers '("string" "string_view" "iostream" "map" "unordered_map"
                     "set" "unordered_set" "vector" "tuple")))
      (concat "^" ws-maybe "\\(?:"
                    "using"     ws "\\(?:namespace" ws
                                     "\\|" id "::"
                                     "\\|" id ws-maybe "=\\)"
              "\\|" "\\(?:inline" ws "\\)?namespace"
                    "\\(?:" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{"
              "\\|" "class"     ws id
                    "\\(?:" ws "final" "\\)?" ws-maybe "[:{;\n]"
              "\\|" "struct"     ws id "\\(?:" ws "final" ws-maybe "[:{\n]"
                                         "\\|" ws-maybe ":\\)"
              "\\|" "template"  ws-maybe "<.*?>"
              "\\|" "#include"  ws-maybe "<" (regexp-opt headers) ">"
              "\\)")))
  "A regexp applied to C header files to check if they are really C++.")