Skip to content

Quick Reference for Choosing C++ Function Parameter Type

Notifications You must be signed in to change notification settings

legends2k/cpp-param-ref

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A reference card / cheat sheet for choosing the right kind of function parameter to receive and return objects in C++ functions. Download reference card.

C++ gives fine-grained control over argument passing and returning that many options exits. There’s been enough over-thinking and discussions in the community. Thankfully experts have noticed this and have arrived at sane defaults. Since the options are more and involved, having a ready reckoner is useful when coding.

The reference card is written in the venerated Org mode.

Dependencies

On Arch Linux, I’d to install these packages

  • texlive-bin (for pdflatex)
  • texlive-latexextra (for wrapfig.sty)
  • texlive-fontsextra (for bbold.sty)
  • texlive-science (for mathematic symbols stmaryrd.sty; optional)
  • community/pygmentize

As a single command

yay -S --needed extra/texlive-latexextra extra/texlive-fontsextra extra/texlive-science community/pygmentize

Other Linux repositories should have equivalent packages to get these.

Emacs Packages

Append this to your Emacs configuration

;; for the the CheatSheetSetup.org section headings to be ignored
(require 'ox-extra)
(ox-extras-activate '(ignore-headlines))

;; for syntax highlighting source blocks
(setq org-latex-listings 'minted
      org-latex-packages-alist '(("" "minted"))
      org-latex-pdf-process
      '("pdflatex -shell-escape -output-directory %o %f"
        "biber %b"
        "pdflatex -shell-escape -output-directory %o %f"
        "pdflatex -shell-escape -output-directory %o %f"))

Generation

  • Edit cpp-params-refcard.org
  • Save
  • Export C-c C-e l o

To Do

  • Add horizontal rules between sections
  • Use mononoki font for monospace using fontspec package

See Also

About

Quick Reference for Choosing C++ Function Parameter Type

Resources

Stars

Watchers

Forks

Packages

No packages published