C# version of __FUNCTION__ macro

后端 未结 6 1783
有刺的猬
有刺的猬 2021-02-19 01:18

Does anyone has a good solution for a C# version of the C++ __FUNCTION__ macro? The compiler does not seem to like it.

6条回答
  •  孤城傲影
    2021-02-19 01:37

    Try using this instead.

    System.Reflection.MethodBase.GetCurrentMethod().Name
    

    C# doesn't have __LINE__ or __FUNCTION__ macros like C++ but there are equivalents

提交回复
热议问题