From 75f54119bf35b3e5a5fdbeb1964cec16d151bd4a Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Fri, 6 Mar 2020 12:05:33 +0900 Subject: [PATCH] Fix use of C++14/C++17, only C++11 is supported --- src/TSLQueue.hpp | 12 ++++++------ src/UDPConnection.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/TSLQueue.hpp b/src/TSLQueue.hpp index 8ac0371..8526cb9 100644 --- a/src/TSLQueue.hpp +++ b/src/TSLQueue.hpp @@ -91,8 +91,8 @@ class TSLQueue { template TSLQueue::TSLQueue() : - head(std::make_shared()), - tail(std::make_shared()), + head(std::shared_ptr(new TSLQNode())), + tail(std::shared_ptr(new TSLQNode())), msize(0) { head->next = tail; @@ -126,8 +126,8 @@ TSLQueue & TSLQueue::operator=(TSLQueue &&other) { template void TSLQueue::push(const T &data) { std::lock_guard lock(mutex); - auto newNode = std::make_shared(); - newNode->data = std::make_unique(data); + auto newNode = std::shared_ptr(new TSLQNode()); + newNode->data = std::unique_ptr(new T(data)); auto last = tail->prev.lock(); assert(last); @@ -142,8 +142,8 @@ void TSLQueue::push(const T &data) { template bool TSLQueue::push_nb(const T &data) { if(mutex.try_lock()) { - auto newNode = std::make_shared(); - newNode->data = std::make_unique(data); + auto newNode = std::shared_ptr(new TSLQNode()); + newNode->data = std::unique_ptr(new T(data)); auto last = tail->prev.lock(); assert(last); diff --git a/src/UDPConnection.cpp b/src/UDPConnection.cpp index 6d7ce8b..36d0932 100644 --- a/src/UDPConnection.cpp +++ b/src/UDPConnection.cpp @@ -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::period::num - / (float)std::decay_t::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) {