title: How to marshal a C++ enum in C#
body: <p>I need to create a wrapper between C++ and C#. I have a function very similar to this:</p>
  
  <pre><code>virtual SOMEINTERFACE* MethodName(ATTRIBUTE_TYPE attribType = ATTRIBUTE_TYPE::ATTRIB_STANDARD) = 0;
  </code></pre>
  
  <p>The <code>enum</code> is declared like this:</p>
  
  <pre><code>enum class ATTRIBUTE_TYPE { 
      ATTRIB_STANDARD, 
      ATTRIB_LENGTH 
  };
  </code></pre>
  
  <p>How do I wrap that ATTRIBUTE_TYPE enum?</p>