locked
Defining generic classes with the same name and different number of type arguments RRS feed

  • Question

  • In C# one could write something like this:

    public static class Test
    {
    }
    
    public class Test<T>
    {
    }


    How can I do the same in C++/CLI?

    I tried to define:

    public ref class Test abstract sealed
    {
    };
    
    generic<typename T>
    public ref class Test
    {
    };


    But I get a C2011 error: "'class' type redefinition.

    I want to create a static class which defines convenient methods for creating instances of my generic class, just like System.Tuple.

    Any help would be greatly appreciated!

    Monday, August 20, 2012 12:39 PM

Answers

All replies