Predefined Live Templates for C/C++
This topic lists all predefined live templates for C/C++ in ReSharper 2024.3. For more information about live templates, refer to 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
|
| XML documentation template Scope C/C++ comments Body /// <summary>
/// $END$
/// </summary>
/// <param name="$PNAME$">$PDESCRIPTION$</param>
/// <param name="$MNAME$">$MDESCRIPTION$</param>
/// <returns>$RETURN$</returns> Parameters
|
| Write to standard output stream Scope C/C++ statements Body std::wcout << $END$; Parameters
|
| Write to standard log stream Scope C/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/C++ statements Body std::wcin >> $END$; Parameters
|
| Default constructor declaration with body Scope C++ type-member declarations Body $CLASSNAME$(){$END$} Parameters
|
| Move constructor declaration with body Scope C++ type-member declarations Body $CLASSNAME$($CLASSNAME$ && $NAME$) noexcept {$END$} Parameters
|
| else statement Scope C/C++ statements Body else
{
$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
|
| 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/C++ statements Body for (int $INDEX$ = $MAX$ - 1; $INDEX$ >= 0 ; --$INDEX$)
{
$SELECTION$$END$
} Parameters
|
| Write to standard log stream Scope C/C++ statements Body std::clog << $END$; Parameters
|
| Documentation template Scope C/C++ comments Body /**
* \brief $END$
* \tparam $TNAME$ $TDESCRIPTION$
* \param $PNAME$ $PDESCRIPTION$
* \param $MNAME$ $MDESCRIPTION$
* \return $RETURN$
*/ Parameters
|
| Write to standard error stream Scope C/C++ statements Body std::wcerr << $END$; Parameters
|
| Write to standard error stream Scope C/C++ statements Body std::cerr << $END$; Parameters
|
| Read from standard input stream Scope C/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/C++ statements Body std::cout << $END$; Parameters
|
| do while loop Scope C/C++ statements Body do
{
$SELECTION$$END$
} while ($EXPR$); Parameters
|
| Enum declaration Scope C++ class declarations, C++ type-member declarations Body enum $NAME$ {$END$}; Parameters
|
| range-based for loop Scope C/C++ statements Body for ($TYPE$ $VARIABLE$ : $COLLECTION$)
{
$SELECTION$$END$
} Parameters
|
| for loop pattern with integer index Scope C/C++ statements Body for (int $INDEX$ = 0; $INDEX$ < $MAX$; ++$INDEX$)
{
$SELECTION$$END$
} Parameters
|
| if statement Scope C/C++ statements Body if ($EXPR$)
{
$SELECTION$$END$
} Parameters
|
| Include guard Scope C/C++ top-level declarations, At line start Body #ifndef $FILENAME$
#define $FILENAME$
$END$
#endif // $FILENAME$
Parameters
|
| main declaration Scope C/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/C++ statements Body switch ($EXPRESSION$) {$END$} Parameters
|
| try catch statement Scope C/C++ statements Body try
{
$SELECTION$$END$
}
catch ($EXCEPTION$) {} Parameters
|
| while statement Scope C/C++ statements Body while ($EXPR$)
{
$SELECTION$$END$
} Parameters
|
| Log a formatted message using UE_LOG Scope Unreal Engine solutions, C/C++ statements Body UE_LOG($CATEGORY$, $VERBOSITY$, TEXT("$END$")); Parameters
|
| UCLASS declaration Scope C++ class declarations, Unreal Engine header files Body UCLASS()
class $NAME$:public $BASE$ {GENERATED_BODY() public:$END$}; Parameters
|
| UENUM declaration Scope C++ class declarations, Unreal Engine header files Body UENUM()
enum $NAME$ {$END$}; Parameters
|
| UENUM declaration using the "enum class" syntax Scope C++ class declarations, Unreal Engine header files Body UENUM()
enum class $NAME$ {$END$}; Parameters
|
| UINTERFACE declaration Scope C++ class declarations, Unreal Engine header files Body UINTERFACE()
class U$NAME$:public UInterface {GENERATED_BODY()};
class I$NAME$ {GENERATED_BODY() public:$END$}; Parameters
|
| USTRUCT declaration Scope C++ class declarations, Unreal Engine header files Body USTRUCT()
struct $NAME$ {GENERATED_BODY() $END$}; Parameters
|
| Log a formatted message using UE_LOGFMT Scope Unreal Engine solutions, C/C++ statements Body UE_LOGFMT($CATEGORY$, $VERBOSITY$, "$END$"); Parameters
|