I've defined an alias for some code to make it easier for the users/developers to do certain actions.
So here's what i have now:
#define manage( val ) bool managed = false; while ( MyClass::manage( val, managed ) )
And then I can use the syntax:
manage( someObj )
{
...some code in here
}
And it will call "manage" both at the beginning bracket and the end (since it's a loop). Here's the problem: if an exception is thrown inside the codeblock (see above "...some code here" ), then it doesn't call "manage" at the end of the code block.
I can do the following, but I MUCH prefer the cleaner, more regular syntax if possible.
#define manage( val ) bool managed = false; try { while ( MyClass::manage( val, managed ) )
#define end_manage( val ) } catch (... ) { MyClass::manage, managed ); }
which allows me the syntax:
manage( someObj )
{
...some code in here
} end_manage( someObj );
and that's not bad, but I MUCH prefer it with just "manage" and the brackets. So my question:
Can i do something equivalent to:
#define manage( val ) bool managed = false; try { while ( MyClass::manage( val, managed ) ) $code_block } catch (...) { MyClass::manage, managed ); }
where "$code_block" signifies to the compiler that's the code in between the brackets?
So here's what i have now:
#define manage( val ) bool managed = false; while ( MyClass::manage( val, managed ) )
And then I can use the syntax:
manage( someObj )
{
...some code in here
}
And it will call "manage" both at the beginning bracket and the end (since it's a loop). Here's the problem: if an exception is thrown inside the codeblock (see above "...some code here" ), then it doesn't call "manage" at the end of the code block.
I can do the following, but I MUCH prefer the cleaner, more regular syntax if possible.
#define manage( val ) bool managed = false; try { while ( MyClass::manage( val, managed ) )
#define end_manage( val ) } catch (... ) { MyClass::manage, managed ); }
which allows me the syntax:
manage( someObj )
{
...some code in here
} end_manage( someObj );
and that's not bad, but I MUCH prefer it with just "manage" and the brackets. So my question:
Can i do something equivalent to:
#define manage( val ) bool managed = false; try { while ( MyClass::manage( val, managed ) ) $code_block } catch (...) { MyClass::manage, managed ); }
where "$code_block" signifies to the compiler that's the code in between the brackets?