Function: c++-mode

c++-mode is an autoloaded, interactive and byte-compiled function defined in cc-mode.el.gz.

Signature

(c++-mode)

Documentation

Major mode for editing C++ code.

To submit a problem report, enter M-x c-submit-bug-report (c-submit-bug-report) from a c++-mode buffer. This automatically sets up a mail buffer with version information already added. You just need to add a description of the problem, including a reproducible test case, and send the message.

To see what version of CC Mode you are running, enter M-x c-version (c-version).

The hook c-mode-common-hook is run with no args at mode initialization, then c++-mode-hook.

Key bindings:
# c-electric-pound
( c-electric-paren
) c-electric-paren
* c-electric-star
, c-electric-semi&comma
/ c-electric-slash
: c-electric-colon
; c-electric-semi&comma
< c-electric-lt-gt
> c-electric-lt-gt
C-M-a c-beginning-of-defun
C-M-e c-end-of-defun
C-M-h c-mark-function
C-M-q c-indent-exp
C-M-q prog-indent-sexp
C-c . c-set-style
C-c : c-scope-operator
C-c <deletechar> c-hungry-delete-forward
C-c C-<backspace> c-hungry-delete-backwards
C-c C-<delete> c-hungry-delete-forward
C-c C-<deletechar> c-hungry-delete-forward
C-c C-DEL c-hungry-delete-backwards
C-c C-\ c-backslash-region
C-c C-a c-toggle-auto-newline
C-c C-b c-submit-bug-report
C-c C-c comment-region
C-c C-d c-hungry-delete-forward
C-c C-e c-macro-expand
C-c C-k c-toggle-comment-style
C-c C-l c-toggle-electric-state
C-c C-n c-forward-conditional
C-c C-o c-set-offset
C-c C-p c-backward-conditional
C-c C-q c-indent-defun
C-c C-s c-show-syntactic-information
C-c C-u c-up-conditional
C-c C-w c-subword-mode(var)/c-subword-mode(fun)
C-c C-z c-display-defun-name
C-c DEL c-hungry-delete-backwards
C-d c-electric-delete-forward
DEL c-electric-backspace
M-a c-beginning-of-statement
M-e c-end-of-statement
M-q c-fill-paragraph
M-q prog-fill-reindent-defun
TAB c-indent-line-or-region
{ c-electric-brace
} c-electric-brace

Probably introduced at or before Emacs version 19.23.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-mode.el.gz
;;;###autoload
(define-derived-mode c++-mode prog-mode "C++"
  "Major mode for editing C++ code.
To submit a problem report, enter `\\[c-submit-bug-report]' from a
c++-mode buffer.  This automatically sets up a mail buffer with
version information already added.  You just need to add a description
of the problem, including a reproducible test case, and send the
message.

To see what version of CC Mode you are running, enter `\\[c-version]'.

The hook `c-mode-common-hook' is run with no args at mode
initialization, then `c++-mode-hook'.

Key bindings:
\\{c++-mode-map}"
  :after-hook (progn (c-make-noise-macro-regexps)
		     (c-make-macro-with-semi-re)
		     (c-update-modeline))
  (c-initialize-cc-mode t)
  (setq abbrev-mode t)
  (c-init-language-vars-for 'c++-mode)
  (c-common-init 'c++-mode)
  (when (featurep 'xemacs)
    (easy-menu-add c-c++-menu))
  (cc-imenu-init cc-imenu-c++-generic-expression)
  (add-hook 'flymake-diagnostic-functions 'flymake-cc nil t)
  (c-run-mode-hooks 'c-mode-common-hook))