Predefined Live Templates for C++
This topic lists all predefined live templates for C++ in ReSharper 2021.1. For more information about live templates, see Create Source Code Using Live Templates
Template | Details |
---|---|
ctx | Current file context Scope everywhere Body $CTX$ Parameters
|
nguid | Insert new GUID Scope everywhere Body $GUID$ Parameters
|
union | union declaration Scope C++ type-member declarations, C++ class declarations Body union $NAME$ {$END$}; Parameters
|
wcout | Write to standard output stream Scope C++ statements Body std::wcout << $END$; Parameters
|
wclog | Write to standard log stream Scope C++ statements Body std::wclog << $END$; Parameters
|
cctor | Copy constructor declaration with body Scope C++ type-member declarations Body $CLASSNAME$($CONSTCLASSNAME$ & $NAME$){$END$} Parameters
|
wcin | Read from standard input stream Scope C++ statements Body std::wcin >> $END$; Parameters
|
ctor | Default constructor declaration with body Scope C++ type-member declarations Body $CLASSNAME$(){$END$} Parameters
|
UCLASS | UCLASS declaration Scope Unreal Engine solutions, C++ class declarations Body UCLASS()
class $NAME$:public $BASE$ {GENERATED_BODY() public:$END$}; Parameters |
UENUMCLASS | UENUM declaration using the "enum class" syntax Scope Unreal Engine solutions, C++ class declarations Body UENUM()
enum class $NAME$ {$END$}; Parameters
|
UENUM | UENUM declaration Scope Unreal Engine solutions, C++ class declarations Body UENUM()
enum $NAME$ {$END$}; Parameters
|
mctor | Move constructor declaration with body Scope C++ type-member declarations Body $CLASSNAME$($CLASSNAME$ && $NAME$) noexcept {$END$} Parameters
|
vdtor | Virtual destructor declaration with body Scope C++ type-member declarations Body virtual ~$CLASSNAME$(){$END$} Parameters
|
enum_to_string | Function 'to_string' for enum Scope C++ namespace declarations Body const char * to_string($ENUM$ e) {
switch (e) {
case $ENUMERATOR$: return $ENUMERATOR_NAME$;
default: return "unknown";
}
} Parameters
|
USTRUCT | USTRUCT declaration Scope Unreal Engine solutions, C++ class declarations Body USTRUCT()
struct $NAME$ {GENERATED_BODY() $END$}; Parameters
|
dtor | Destructor declaration with body Scope C++ type-member declarations Body ~$CLASSNAME$(){$END$} Parameters
|
enumclass | Enum class declaration Scope C++ type-member declarations, C++ class declarations Body enum class $NAME$ {$END$}; Parameters
|
forr | Reversed for Scope C++ statements Body for (int $INDEX$ = $MAX$ - 1; $INDEX$ >= 0 ; --$INDEX$)
{
$SELECTION$$END$
} Parameters
|
clog | Write to standard log stream Scope C++ statements Body std::clog << $END$; Parameters
|
doc | Documentation template Scope C++ comments Body /**
* \brief $END$
* \tparam $TNAME$ $TDESCRIPTION$
* \param $PNAME$ $PDESCRIPTION$
* \param $MNAME$ $MDESCRIPTION$
* \return $RETURN$
*/ Parameters
|
foreach | range-based for loop Scope C++ statements Body for ($TYPE$ $VARIABLE$ : $COLLECTION$)
{
$SELECTION$$END$
} Parameters
|
wcerr | Write to standard error stream Scope C++ statements Body std::wcerr << $END$; Parameters
|
cerr | Write to standard error stream Scope C++ statements Body std::cerr << $END$; Parameters
|
cin | Read from standard input stream Scope C++ statements Body std::cin >> $END$; Parameters
|
class | Class declaration Scope C++ class declarations, C++ type-member declarations Body class $NAME$ {public:$END$}; Parameters
|
cout | Write to standard output stream Scope C++ statements Body std::cout << $END$; Parameters
|
do | do while loop Scope C++ statements Body do
{
$SELECTION$$END$
} while ($EXPR$); Parameters
|
enum | Enum declaration Scope C++ class declarations, C++ type-member declarations Body enum $NAME$ {$END$}; Parameters
|
fori | for loop pattern with integer index Scope C++ statements Body for (int $INDEX$ = 0; $INDEX$ < $MAX$; ++$INDEX$)
{
$SELECTION$$END$
} Parameters
|
if | if statement Scope C++ statements Body if ($EXPR$)
{
$SELECTION$$END$
} Parameters
|
incg | Include guard Scope C++ top-level declarations, at line start Body #ifndef $FILENAME$
#define $FILENAME$
$END$
#endif // $FILENAME$
Parameters
|
main | main declaration Scope C++ top-level declarations Body int main(int argc, char *argv[])
{
$END$
}
Parameters
|
namespace | namespace declaration Scope C++ namespace declarations Body namespace $NAME$ {$END$} Parameters
|
struct | struct declaration Scope C++ class declarations, C++ type-member declarations Body struct $NAME$ {$END$}; Parameters
|
switch | switch statement Scope C++ statements Body switch ($EXPRESSION$) {$END$} Parameters
|
try | try catch statement Scope C++ statements Body try
{
$SELECTION$$END$
}
catch ($EXCEPTION$) {} Parameters
|
while | while statement Scope C++ statements Body while ($EXPR$)
{
$SELECTION$$END$
} Parameters
|