是否可以定义一个接受如下表达式的宏:object.method()
?我想制作一个宏,将该表达式更改为...什么都没有(有点删除它)。只需function()
我会做:(#define function
没有任何价值)但是可以创建一个带有点的宏吗?
编辑:关于 MooingDuck 的评论:
object.Method("text", "other");
定义:
void Class::Method(std::string arg1, std::string arg2)
{
#if 0
if (condition)
{
Method2(arg1, arg2);
}
#endif
}
拆卸:
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