Predefined Surround Templates for C++
This topic lists all predefined surround templates for C++ in ReSharper 2016.1.1. For more information about surround templates, see Surrounding Code Fragments with Templates
Template | Details |
---|---|
()
|
Surround the selection with parentheses Scope C++ expressions, C# 2.0+ expressions ($SELECTION$$END$) |
{}
|
Surround the selection with braces {
$SELECTION$$END$
} |
static_cast
|
Surround the selected expression with
static_cast<$TYPE$>($SELECTION$)
|
struct
|
Surround selected declarations with
Scope C++ type-member declarations, C++ class declarations struct $NAME$ { $SELECTION$ }; |
dynamic_cast
|
Surround the selected expression with
dynamic_cast<$TYPE$>($SELECTION$)
|
namespace
|
Add a namespace to the selected code Scope C++ namespace declarations, C++ top-level declarations namespace { $SELECTION$$END$ } |
#if...#endif
|
#if $END$
$SELECTION$
#endif |
if
|
Put the selection into an
if ($END$) { $SELECTION$ } |
const_cast
|
Surround the selected expression with
const_cast<$TYPE$>($SELECTION$)
|
reinterpret_cast
|
Surround the selected expression with
reinterpret_cast<$TYPE$>($SELECTION$)
|
while
|
Put the selection into a
while ($END$) { $SELECTION$ } |
for
|
Put the selection into a
for ($END$) { $SELECTION$ } |
do...while
|
Put the selection into a
do { $SELECTION$ } while($END$) |
try...catch
|
Put the selection into the
try {$SELECTION$} catch ($END$) {} |
cast
|
Cast the selection to a specific type (($TYPE$) $SELECTION$)
|
namespace ...
|
namespace ... Scope C++ namespace declarations, C++ top-level declarations namespace $NAME$ { $SELECTION$$END$ }
|
class
|
Add a class to the selected code Scope C++ class declarations, C++ type-member declarations class $NAME$ { $SELECTION$ }; |
incg
|
Surround selection with an include guard #ifndef $FILENAME$_H
#define $FILENAME$_H
$SELECTION$
#endif // $FILENAME$_H
|
if...else
|
Put the selection into an
if ($COND$) {$SELECTION$} else {$END$}
|