Predefined Surround Templates for C++
This topic lists all predefined surround templates for C++ in ReSharper 2021.1. For more information about surround templates, see Surround Code Fragments with Templates
Template | Details |
---|---|
forr | Reversed for Scope C++ statements Body for (int $INDEX$ = $MAX$ - 1; $INDEX$ >= 0 ; --$INDEX$)
{
$SELECTION$$END$
} Parameters
|
foreach | range-based for loop Scope C++ statements Body for ($TYPE$ $VARIABLE$ : $COLLECTION$)
{
$SELECTION$$END$
} Parameters
|
do | do while loop Scope C++ statements Body do
{
$SELECTION$$END$
} while ($EXPR$); 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
|
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
|
static_cast | static_cast expression Scope C++ expressions Body static_cast<$TYPE$>($SELECTION$) Parameters
|
dynamic_cast | dynamic_cast expression Scope C++ expressions Body dynamic_cast<$TYPE$>($SELECTION$) Parameters
|
namespace | Anonymous namespace declaration Scope C++ namespace declarations Body namespace
{
$SELECTION$$END$
} Parameters
|
#if...#endif | Code snippet for #if...#endif preprocessor directive Scope C++, at line start Body #if $END$
$SELECTION$
#endif
Parameters
|
const_cast | const_cast expression Scope C++ expressions Body const_cast<$TYPE$>($SELECTION$) Parameters
|
reinterpret_cast | reinterpret_cast expression Scope C++ expressions Body reinterpret_cast<$TYPE$>($SELECTION$) Parameters
|
cast | C-like cast expression Scope C++ expressions Body (($TYPE$) $SELECTION$) Parameters
|
namespace ... | namespace declaration Scope C++ namespace declarations Body namespace $NAME$
{
$SELECTION$$END$
} Parameters
|
if...else | if else statement Scope C++ statements Body if ($COND$)
{
$SELECTION$
}
else
{
$END$
} Parameters
|