(C++) code template

January 2, 2018 ยท View on GitHub

Code templates are predefined pieces of code that can be inserted by a keyboard shortcut. Not all IDEs support code templates.

Example

In the C++ Builder 6.0 IDE, one can define a code template as follows:

for (int i=0; i!=|; ++i) {  }

The bar ('|') denotes the cursor position after insertion.

This code can be inserted by using CTRL-J and the code template's shortcut, for example 'i'.