title: What are the advantages of doing 100% managed development using C++/CLI?
body: <p>What are the advantages (the list of possible disadvantages is lenghtly) of doing <strong>100% managed</strong> development using C++/CLI (that is, compile with <a href="http://msdn.microsoft.com/en-us/library/85344whh(VS.80).aspx" rel="nofollow noreferrer">/clr:safe</a> which "generates ... assemblies, like those written in ... C#")?  Especially when compard to C# (note <a href="https://stackoverflow.com/questions/1886881/c-cli-advantages-over-c">C++/CLI : Advantages over C#</a> and <a href="https://stackoverflow.com/questions/297323/is-there-any-advantage-to-using-c-cli-over-either-standard-c-or-c">Is there any advantage to using C++/CLI over either standard C++ or C#?</a> are mostly about managed/unmanaged interop).</p>
  
  <p>For example, here are a few off the top of my head:</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/2181846/how-can-i-get-close-to-non-nullable-types-in-c-today">C++-style references for managed types</a>, not as elegant as full blown <a href="https://stackoverflow.com/search?q=non-nullable">non-nullable</a> references but better than nothing or using a <a href="http://msmvps.com/blogs/jon_skeet/archive/2008/10/06/non-nullable-reference-types.aspx" rel="nofollow noreferrer">work-around</a>.</p></li>
  <li><p>templates which are more powerful than generics</p></li>
  <li><p>preprocessor (this may be a disadvantage!, but macros can be useful for code generation)</p></li>
  <li><p>stack semantics for reference types--automatically calling <em>IDisposable::Dispose()</em></p></li>
  <li><p>easier implementation of <em>Dispose()</em> via C++ destructor</p></li>
  </ul>
  
  <p>C# 3.0 added auto-implemented properties, so that is no longer a C++/CLI advantage.</p>