I usually like to check the validity of a value in the setter, so I have changed the encapsulate field snippet so that the setter returns bool:
$end$$SymbolType$& Get$GeneratedPropertyName$()
{
return $SymbolName$;
}
bool Set$GeneratedPropertyName$(const $SymbolType$& val)
{
// TODO: validity check of val
$SymbolName$ = val;
return true;
}
When I run the snippet, it seems like Visual Assist fails to separate the method names of the getter and setter, as shown on the screenshot.
I then have to place the comma manually at the appropriate position, to separate the getter and setter method names and press ok. However, the produced setter then has the same name as the getter.
double& GetDW_Positive_mm()
{
return m_dDW_Positive_mm;
}
bool GetDW_Positive_mm(const double& val)
{
// TODO: validity check of val
m_dDW_Positive_mm = val;
return true;
}