Predefined Live Templates for C++
This topic lists all predefined live templates for C++ in JetBrains Rider 2021.2. For more information about live templates, see Create source code using live templates
Template | Details |
---|---|
| Current file context Scope everywhere Body $CTX$ Parameters
|
| Insert new GUID Scope everywhere Body $GUID$ Parameters
|
| union declaration Scope C++ type-member declarations, C++ class declarations Body union $NAME$ {$END$}; Parameters
|
| Write to standard output stream Scope C++ statements Body std::wcout << $END$; Parameters
|
| Write to standard log stream Scope C++ statements Body std::wclog << $END$; Parameters
|
| Copy constructor declaration with body Scope C++ type-member declarations Body $CLASSNAME$($CONSTCLASSNAME$ & $NAME$){$END$} Parameters
|
| Read from standard input stream Scope C++ statements Body std::wcin >> $END$; Parameters
|
| Default constructor declaration with body Scope C++ type-member declarations Body $CLASSNAME$(){$END$} Parameters
|
| UCLASS declaration Scope Unreal Engine solutions, C++ class declarations Body UCLASS()
class $NAME$:public $BASE$ {GENERATED_BODY() public:$END$}; Parameters
|
| UENUM declaration using the "enum class" syntax Scope Unreal Engine solutions, C++ class declarations Body UENUM()
enum class $NAME$ {$END$}; Parameters
|
| UENUM declaration Scope Unreal Engine solutions, C++ class declarations Body UENUM()
enum $NAME$ {$END$}; Parameters
|
| Move constructor declaration with body Scope C++ type-member declarations Body $CLASSNAME$($CLASSNAME$ && $NAME$) noexcept {$END$} Parameters
|
| Virtual destructor declaration with body Scope C++ type-member declarations Body virtual ~$CLASSNAME$(){$END$} Parameters
|
| 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
This template is expanded when you invoke the Convert enum to string context action on an enum declaration. |
| USTRUCT declaration Scope Unreal Engine solutions, C++ class declarations Body USTRUCT()
struct $NAME$ {GENERATED_BODY() $END$}; Parameters
|
| Destructor declaration with body Scope C++ type-member declarations Body ~$CLASSNAME$(){$END$} Parameters
|
| Enum class declaration Scope C++ type-member declarations, C++ class declarations Body enum class $NAME$ {$END$}; Parameters
|
| Reversed for Scope C++ statements Body for (int $INDEX$ = $MAX$ - 1; $INDEX$ >= 0 ; --$INDEX$)
{
$SELECTION$$END$
} Parameters
|
| Write to standard log stream Scope C++ statements Body std::clog << $END$; Parameters
|
| Documentation template Scope C++ comments Body /**
* \brief $END$
* \tparam $TNAME$ $TDESCRIPTION$
* \param $PNAME$ $PDESCRIPTION$
* \param $MNAME$ $MDESCRIPTION$
* \return $RETURN$
*/ Parameters
This template is expanded when you invoke the Document context action on a type or type member. |
| range-based for loop Scope C++ statements Body for ($TYPE$ $VARIABLE$ : $COLLECTION$)
{
$SELECTION$$END$
} Parameters
|
| Write to standard error stream Scope C++ statements Body std::wcerr << $END$; Parameters
|
| Write to standard error stream Scope C++ statements Body std::cerr << $END$; Parameters
|
| Read from standard input stream Scope C++ statements Body std::cin >> $END$; Parameters
|
| Class declaration Scope C++ class declarations, C++ type-member declarations Body class $NAME$ {public:$END$}; Parameters
|
| Write to standard output stream Scope C++ statements Body std::cout << $END$; Parameters
|
| do while loop Scope C++ statements Body do
{
$SELECTION$$END$
} while ($EXPR$); Parameters
|
| Enum declaration Scope C++ class declarations, C++ type-member declarations Body enum $NAME$ {$END$}; Parameters
|
| for loop pattern with integer index Scope C++ statements Body for (int $INDEX$ = 0; $INDEX$ < $MAX$; ++$INDEX$)
{
$SELECTION$$END$
} Parameters
|
| if statement Scope C++ statements Body if ($EXPR$)
{
$SELECTION$$END$
} Parameters
|
| Include guard Scope C++ top-level declarations, at line start Body #ifndef $FILENAME$
#define $FILENAME$
$END$
#endif // $FILENAME$
Parameters
|
| main declaration Scope C++ top-level declarations Body int main(int argc, char *argv[])
{
$END$
}
Parameters
|
| namespace declaration Scope C++ namespace declarations Body namespace $NAME$ {$END$} Parameters
|
| struct declaration Scope C++ class declarations, C++ type-member declarations Body struct $NAME$ {$END$}; Parameters
|
| switch statement Scope C++ statements Body switch ($EXPRESSION$) {$END$} Parameters
|
| try catch statement Scope C++ statements Body try
{
$SELECTION$$END$
}
catch ($EXCEPTION$) {} Parameters
|
| while statement Scope C++ statements Body while ($EXPR$)
{
$SELECTION$$END$
} Parameters
|