I have some code which creates a synchronised queue which I use in a data gathering class to report it's data. The method which creates queues is kicking up a warning:
Queue^% DataGatherer::AddOutputQueue()
{
Queue^ outputQueue = Queue::Synchronized(gcnew Queue);
AddOutputQueue(outputQueue);
return outputQueue;
}
1>.\DataGatherer.cpp(21) : warning C4172: returning address of local variable or temporary
Is this a warning I should be worried about or am I safe in this case and it's just the compiler getting confused about Queue::Synchronized
returning a Queue^
? The code appears to run fine, but warnings make me nervous ;-)