![]() |
| ||
| Generic type-union conflict,error? Busy writing an infix to postfix converter.(I'm a strange guy. I like to do those things from time to time...) I have a class Expression which is in essence : [StructLayout(LayoutKind.Explicit)] //in c/c++ this is a unionBtw wonder why they left out the union keyword in C#. I found this "way" to do it in C# on MSDN. In my Main I have : Expression E = new Expression();The last line gives me the error message Error 1 Cannot implicitly convert type 'System.Collections.Generic.Queue<ConsoleInfixToPostfix.Expression.Valoper>' to 'System.Collections.Generic.Queue<Valoper> I'm using VS 2008 Express C# here. What am I doing wrong? Any help would be nice. |
| ||
| Re: Generic type-union conflict,error? hmmm, compiles fine for me you sure Expression.Valoper is the same class as Valoper? |
| ||
| Re: Generic type-union conflict,error? The struct Valoper is defined in the Expression class. The line with the error I have is called from Main in the Program class. I don't know why it shouldn't work, that's why I posted it here. Did you really tried it out and it worked at your place? |
| ||
| Re: Generic type-union conflict,error? lol yeh man, it worked fine, will you post the whole class structure then? |
| ||
| Re: Generic type-union conflict,error? Still wondering 'bout the error message. Difference between pro and express versions? I will mark this as solved. |
| All times are GMT -4. The time now is 9:53 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC