matrix<T> statt matrix<T,3,3,column-major>



  • ich würde gerne folgendes machen:

    template <typename T>
    typedef matrix<T, detail::fixed<3, 3>, detail::column_basis, detail::column_major>			matrix33<T>;
    

    mein Compiler meint Error "a typedef template is illegal"

    der Workaround sieht jetzt so aus:

    template <
    	typename ElementType
    >
    class matrix33
    	: public matrix<ElementType, detail::fixed<3, 3>, detail::column_basis, detail::column_major>
    {
    public:
    	matrix33() : matrix()
    	{
    
    	}
    
    	matrix33(                                                                 
    		ElementType e00, ElementType e01, ElementType e02,   
    		ElementType e10, ElementType e11, ElementType e12,   
    		ElementType e20, ElementType e21, ElementType e22    
    		) : matrix( e00,e01,e02,                                                   
    					e10,e11,e12,                                                   
    					e20,e21,e22    )                                                     
    	{                                                                     
    
    	}
    };
    

    Gibt es eine bessere Möglichkeit?



  • mist das sollte in C++ Forum (bitte verschieben)



  • Im bisherigen Standard ist sowas nicht möglich. Im (afaik noch nicht gültigen) C++0x gibt es die Möglichkeit für template-aliase, die dein Problem lösen könnten (und bestimmt kommt gleich jemand, der die dafür nötige Syntax kennt).


Anmelden zum Antworten