title: Is there any way to perform divisions on a generic type in .net (C++-CLI)?
body: <p>I'm trying to create a simple rolling mean implementation for generic numerical type but have hit a stumbling block:</p>
  
  <pre><code>generic&lt;typename T&gt;
  public ref class RollingMean
  {
  protected:
      CircularBuffer&lt;T&gt; m_dataBuffer;
      T m_currentSum;
  
  public:
      RollingMean(const int NumOfItems);
  
      T AddItem(const T NewItem);
  
      T CurrentMean()
      {
          return m_currentSum / static_cast&lt;float&gt;(m_dataBuffer.Length); // &lt;--- gives me compiler error C2676
      }
  };
  </code></pre>
  
  <p>This gives me a compiler error:</p>
  
  <pre><code>1&gt;c:\projects\util\RollingMean.h(21): error C2676: binary '/' : 'T' does not define this operator or a conversion to a type acceptable to the predefined operator
  1&gt;RollingMean.cpp(6): error C2955: 'MathHelpers::RollingMean' : use of class generic requires generic argument list
  1&gt;          c:\projects\util\RollingMean.h(9) : see declaration of 'MathHelpers::RollingMean'
  </code></pre>
  
  <p>Is there any way to limit the generic classes to those that are happy with numeric operations?</p>