Is it possible to define a macro that would accept expression like: object.method()
? I would like to make a macro that changes that expression into... nothing (kind of deletes it). With just function()
I would do: #define function
(without any value) but is it possible to create a macro with dot in it?
Edit: Regarding MooingDuck's comment:
object.Method("text", "other");
Definition:
void Class::Method(std::string arg1, std::string arg2)
{
#if 0
if (condition)
{
Method2(arg1, arg2);
}
#endif
}
Disassembly:
object.Method("text", "other");
00394396 mov edi,5
0039439B mov eax,offset string "other" (396348h)
003943A0 lea esi,[ebp-4Ch]
003943A3 mov dword ptr [ebp-38h],0Fh
003943AA mov dword ptr [ebp-3Ch],ebx
003943AD mov byte ptr [ebp-4Ch],bl
003943B0 call std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign (393360h)
003943B5 mov dword ptr [ebp-4],1
003943BC mov edi,4
003943C1 mov eax,offset string "text" (396350h)
003943C6 lea esi,[ebp-30h]
003943C9 mov dword ptr [ebp-1Ch],0Fh
003943D0 mov dword ptr [ebp-20h],ebx
003943D3 mov byte ptr [ebp-30h],bl
003943D6 call std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign (393360h)
003943DB mov esi,10h
003943E0 mov dword ptr [ebp-4],0FFFFFFFFh
003943E7 cmp dword ptr [ebp-1Ch],esi
003943EA jb main+0B9h (3943F9h)
003943EC mov eax,dword ptr [ebp-30h]
003943EF push eax
003943F0 call dword ptr [__imp_operator delete (3960ECh)]
003943F6 add esp,4
003943F9 mov edi,0Fh
003943FE mov dword ptr [ebp-1Ch],edi
00394401 mov dword ptr [ebp-20h],ebx
00394404 mov byte ptr [ebp-30h],bl
00394407 cmp dword ptr [ebp-38h],esi
0039440A jb main+0D9h (394419h)
0039440C mov ecx,dword ptr [ebp-4Ch]
0039440F push ecx
00394410 call dword ptr [__imp_operator delete (3960ECh)]
00394416 add esp,4