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