x


Syntax error with Queue

I copied some code from a sample project, declaring a queue to hold a struct (I think) called "FrameOfMocapData" from NatNetML. In my project, it has some weird syntax problem.

using System.Collections;
using NatNetML;

This line:

private Queue<NatNetML.FrameOfMocapData> m_FrameQueue = new Queue<NatNetML.FrameOfMocapData>();

Gives this error: "error CS0308: The non-generic type 'System.Collections.Queue' cannot be used with the type arguments'

This shorter version of the line gives the same error:

private Queue<NatNetML.FrameOfMocapData> m_FrameQueue 

The original code is written in C#, and it works fine. Any idea what the problem could be?

more ▼

asked Feb 06 '11 at 10:08 PM

Simon 9 gravatar image

Simon 9
42 10 10 15

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You want using System.Collections.Generic; added as well.

Most of the generic containers are in there

more ▼

answered Feb 06 '11 at 10:11 PM

Mike 3 gravatar image

Mike 3
30.6k 10 67 254

thank you very much

Feb 06 '11 at 10:21 PM Simon 9
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x135
x33
x4

asked: Feb 06 '11 at 10:08 PM

Seen: 1941 times

Last Updated: Feb 06 '11 at 10:08 PM