I would like to have simplification of my code, as in example on C++
#define MACR( a )\{\ if ( a == NULL )\ {\ ASSERT( false );\ return NULL;\ }\}
#define MACR2( a )\{\ if ( !(a) )\ {\ ASSERT( false );\ return NULL;\ }\}
int* SomeFunc()
{
bool* pArray = new bool[ 1000 ];
MACR( pArray );
MACR2( SomeFunc2() );
}
bool SomeFunc2()
{
//some code
If ( some error condition )
return false;
//G?.. some code
return true;
}
This will make error check of memory allocation and return values of functions very easy and comfortable in C#.
If there is no way to have this functionality in C#, may it would be wonderful to have macroses in C#.
Could you please implement some kind of preproceccor for C# files which will make preprocessing of C++ macroses in "*.cs" files and then will start C# compilator of Visual Studio.