Consider the following bit of code:
#include <queue>
#include <memory>
std::shared_ptr<char> oneSharedPtr(new char[100]);
std::queue<std::shared_ptr<char>> stringQueue;
stringQueue.queue(oneSharedPtr);
This results in
error C2274: 'function-style cast' : illegal as right side of '.' operator
Why is this? Is it safe to use shared pointers in queues (will the shared pointer's ref count go to 0 on a pop)?