C# Macro definitions in Preprocessor

前端 未结 10 1720
走了就别回头了
走了就别回头了 2020-11-29 04:16

Is C# able to define macros as is done in the C programming language with pre-processor statements? I would like to simplify regular typing of certain repeating statements

10条回答
  •  Happy的楠姐
    2020-11-29 05:04

    Luckily, C# has no C/C++-style preprocessor - only conditional compilation and pragmas (and possibly something else I cannot recall) are supported. Unfortunatelly, C# has no metaprogramming capabilities (this may actually relate to your question to some extent).

提交回复
热议问题