In our code we have quite a few cases of this pattern:
class outerClass
{
struct innerStruct
{
wstring operator()( wstring value )
{
//do something
return value;
}
};
void doThing()
{
wstring initialValue;
wstring finalValue = innerStruct()( initialValue );
}
};
What's the advantage of this over:
class outerClass
{
wstring changeString( wstring value )
{
//do something
return value;
}
void doThing()
{
wstring initialValue;
wstring finalValue = changeString( initialValue );
}
};