pointer to a array of type generic?
<p>I'd like to create a generic method that uses a pointer to an array of T where T could be a C# primitive, or a C# class.  I was going along fine until I attempted the "T" part.</p>

<p>Is there a way around the error "can not declare a pointer to a non unmanaged type TIn"</p>

<p>I tried to use pinning via the "fixed" keyword to make this possible.</p>

<pre><code>    public static object DoSomething&lt;TIn, TOut&gt;(object SObj, Action&lt;TIn, TOut&gt; takeAction)
    {
        double[]A = (double[]) SObj;
        TIn[]B = new TIn[5];
        unsafe
        {
            fixed (double* dbl = A) // &lt;--- works okay
            {

            }
            fixed (TIn* Sptr = B)  // &lt;--- fails
            {

            }
        }
    }
</code></pre>

<p>--</p>

<p>@dtb: just checked out blittable.  "One-dimensional arrays of blittable types, such as an array of integers. However, a type that contains a variable array of blittable types is not itself blittable."  Even if there was a biltable constraint, it seems like they've limited it to arrays of one dimension.</p>
