Fix use of C++14/C++17, only C++11 is supported

This commit is contained in:
Stephen Seo 2020-03-06 12:05:33 +09:00
parent c37909bde3
commit 75f54119bf
2 changed files with 8 additions and 8 deletions

View file

@ -91,8 +91,8 @@ class TSLQueue {
template <typename T>
TSLQueue<T>::TSLQueue() :
head(std::make_shared<TSLQNode>()),
tail(std::make_shared<TSLQNode>()),
head(std::shared_ptr<TSLQNode>(new TSLQNode())),
tail(std::shared_ptr<TSLQNode>(new TSLQNode())),
msize(0)
{
head->next = tail;
@ -126,8 +126,8 @@ TSLQueue<T> & TSLQueue<T>::operator=(TSLQueue &&other) {
template <typename T>
void TSLQueue<T>::push(const T &data) {
std::lock_guard<std::mutex> lock(mutex);
auto newNode = std::make_shared<TSLQNode>();
newNode->data = std::make_unique<T>(data);
auto newNode = std::shared_ptr<TSLQNode>(new TSLQNode());
newNode->data = std::unique_ptr<T>(new T(data));
auto last = tail->prev.lock();
assert(last);
@ -142,8 +142,8 @@ void TSLQueue<T>::push(const T &data) {
template <typename T>
bool TSLQueue<T>::push_nb(const T &data) {
if(mutex.try_lock()) {
auto newNode = std::make_shared<TSLQNode>();
newNode->data = std::make_unique<T>(data);
auto newNode = std::shared_ptr<TSLQNode>(new TSLQNode());
newNode->data = std::unique_ptr<T>(new T(data));
auto last = tail->prev.lock();
assert(last);

View file

@ -1780,8 +1780,8 @@ uint32_t UDPC::generateConnectionID(Context &ctx) {
float UDPC::durationToFSec(const std::chrono::steady_clock::duration& duration) {
return (float)duration.count()
* (float)std::decay_t<decltype(duration)>::period::num
/ (float)std::decay_t<decltype(duration)>::period::den;
* (float)std::chrono::steady_clock::duration::period::num
/ (float)std::chrono::steady_clock::duration::period::den;
}
uint16_t UDPC::durationToMS(const std::chrono::steady_clock::duration& duration) {