title: C++ Stop Preprocessor Macro Expansion
body: <p>Here is my example code <a href="https://godbolt.org/z/VKgKik" rel="noreferrer">https://godbolt.org/z/VKgKik</a></p>
  
  <pre><code>#define delete MyCustomDelete(__FILE__, __LINE__), delete
  
  #define CAT(X,Y) CAT2(X,Y)
  #define CAT2(X,Y) X##Y
  #define CAT_3(X,Y,Z) CAT(X,CAT(Y,Z))    
  
  
  class A {
      A() = CAT_3(de,le,te);
  };
  </code></pre>
  
  <p>The godbolt example is setup to display the preprocessor output. The goal is that at the end of the preprocessor pass i want the output code to be</p>
  
  <pre><code>class A {
      A() = delete;
  };
  </code></pre>
  
  <p>currently "ThisShouldNotshowUp" is displayed there instead. I thought the use of the ## operator would stop the preprocessor from reexpanding but it did not.</p>
  
  <p>I realize removing the "#define delete" would solve the problem but I need this define there. The reason I have created a macro with the same name as delete is because I want to be able to track the news and deletes, and If a memory leak occurs I can see what line of code aloced it. This macro thus means I can continue to use the keyword delete in my code and the File and line numbers get filled in for free. As far as i know there is no other way to achieve this functionailty except by defined a delete macro. This is the crux of the problem. The delete macro has given me a powerful debug tool however it has removed a useful language feature for me to use.</p>