Re: using = <type> directive

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Dec 11, 10:41 am, "Peter Duniho" <NpOeStPe...@xxxxxxxxxxxxxxxx>
wrote:
On Mon, 10 Dec 2007 14:41:35 -0800, Dylan Nicholson <wizof...@xxxxxxxxxxx>
wrote:

Can someone confirm that a) is illegal, and b) the solution?

Well, you could have used, instead of b), this:

namespace Test
{
using MyQueue = System.Collections.Generic.Queue<MyStruct>;

struct MyStruct
{
int a;
int b;
}

class MyClass
{
MyQueue q = new MyQueue();
}

}


Ah, well, I thought I'd tried that, and because it put a squiggly line
under "MyStruct" in the using directive when I typed it, I assumed it
wasn't legal. But you're right, this is fine, and not really all that
silly.

.



Relevant Pages

  • Re: Sending a struct over a UDP socket...
    ... > struct myStruct { ... > int a; ... You'll notice that these two variables are pointers. ... then sends the structure to the receiving program. ...
    (comp.os.linux.networking)
  • Re: mxCreateStructMatrix problem
    ... int =3DA0T =3D3D100; ... struct mystruct *X; ... field of an mxArray structure is another mxArray, ... Of course you get that error; that should teach me not to post code ...
    (comp.soft-sys.matlab)
  • Re: mxCreateStructMatrix problem
    ... struct mystruct *X; ... field of an mxArray structure is another mxArray, ... int  T =3D100; ...
    (comp.soft-sys.matlab)
  • Re: global struct declarations
    ... > int a; ... > struct mystruct bar; ... That is because it is not a declaration, but a type definition. ...
    (comp.lang.c)
  • Re: mxCreateStructMatrix problem
    ... struct mystruct *X; ... I think you'll need to use mxGetField on the mxArray plhsinstead ... mxArray is conceptually identical to an array of structs in the C ... void mexFunction(int nlhs, mxArray *plhs, int nrhs, const mxArray ...
    (comp.soft-sys.matlab)