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

View file

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