Predefined Surround Templates for C++
This topic lists all predefined surround templates for C++ in JetBrains Rider 2024.1. For more information about surround templates, refer to Surround code fragments with templates.
Template | Details |
---|---|
| Reversed for Scope C++ statements Body for (int $INDEX$ = $MAX$ - 1; $INDEX$ >= 0 ; --$INDEX$)
{
$SELECTION$$END$
} Parameters
|
| Write to standard error stream Scope C++ statements Body std::wcerr << $END$; Parameters
|
| do while loop Scope C++ statements Body do
{
$SELECTION$$END$
} while ($EXPR$); Parameters
|
| range-based for loop Scope C++ statements Body for ($TYPE$ $VARIABLE$ : $COLLECTION$)
{
$SELECTION$$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
|
| try catch statement Scope C++ statements Body try
{
$SELECTION$$END$
}
catch ($EXCEPTION$) {} Parameters
|
| while statement Scope C++ statements Body while ($EXPR$)
{
$SELECTION$$END$
} Parameters
|
| static_cast expression Scope C++ expressions Body static_cast<$TYPE$>($SELECTION$) Parameters
|
| dynamic_cast expression Scope C++ expressions Body dynamic_cast<$TYPE$>($SELECTION$) Parameters
|
| Anonymous namespace declaration Scope C++ namespace declarations Body namespace
{
$SELECTION$$END$
} Parameters
|
| Code snippet for #if...#endif preprocessor directive Scope C++, At line start Body #if $END$
$SELECTION$
#endif
Parameters
|
| const_cast expression Scope C++ expressions Body const_cast<$TYPE$>($SELECTION$) Parameters
|
| reinterpret_cast expression Scope C++ expressions Body reinterpret_cast<$TYPE$>($SELECTION$) Parameters
|
| C-like cast expression Scope C++ expressions Body (($TYPE$) $SELECTION$) Parameters
|
| namespace declaration Scope C++ namespace declarations Body namespace $NAME$
{
$SELECTION$$END$
} Parameters
|
| Include guard surround template Scope C++ top-level declarations, At line start Body #ifndef $FILENAME$
#define $FILENAME$
$SELECTION$
#endif // $FILENAME$ Parameters
|
| if else statement Scope C++ statements Body if ($COND$)
{
$SELECTION$
}
else
{
$END$
} Parameters
|