Remove pre-C++17 shims (#1752)

Now that all compilers support C++17, remove some old C++14/C++17 shims.
This commit is contained in:
Peter Johnson
2019-07-07 15:44:43 -07:00
committed by GitHub
parent ea9512977c
commit 8757bc471b
16 changed files with 71 additions and 271 deletions

View File

@@ -64,7 +64,7 @@ int ConfigurableSourceImpl::CreateProperty(const wpi::Twine& name,
std::lock_guard<wpi::mutex> lock(m_mutex);
int ndx = CreateOrUpdateProperty(name,
[=] {
return wpi::make_unique<PropertyImpl>(
return std::make_unique<PropertyImpl>(
name, kind, minimum, maximum, step,
defaultValue, value);
},

View File

@@ -8,7 +8,6 @@
#include "HttpCameraImpl.h"
#include <wpi/MemAlloc.h>
#include <wpi/STLExtras.h>
#include <wpi/TCPConnector.h>
#include <wpi/timestamp.h>
@@ -149,7 +148,7 @@ wpi::HttpConnection* HttpCameraImpl::DeviceStreamConnect(
if (!m_active || !stream) return nullptr;
auto connPtr = wpi::make_unique<wpi::HttpConnection>(std::move(stream), 1);
auto connPtr = std::make_unique<wpi::HttpConnection>(std::move(stream), 1);
wpi::HttpConnection* conn = connPtr.get();
// update m_streamConn
@@ -322,7 +321,7 @@ void HttpCameraImpl::DeviceSendSettings(wpi::HttpRequest& req) {
if (!m_active || !stream) return;
auto connPtr = wpi::make_unique<wpi::HttpConnection>(std::move(stream), 1);
auto connPtr = std::make_unique<wpi::HttpConnection>(std::move(stream), 1);
wpi::HttpConnection* conn = connPtr.get();
// update m_settingsConn
@@ -377,7 +376,7 @@ void HttpCameraImpl::CreateProperty(const wpi::Twine& name,
int minimum, int maximum, int step,
int defaultValue, int value) const {
std::lock_guard<wpi::mutex> lock(m_mutex);
m_propertyData.emplace_back(wpi::make_unique<PropertyData>(
m_propertyData.emplace_back(std::make_unique<PropertyData>(
name, httpParam, viaSettings, kind, minimum, maximum, step, defaultValue,
value));
@@ -391,7 +390,7 @@ void HttpCameraImpl::CreateEnumProperty(
const wpi::Twine& name, const wpi::Twine& httpParam, bool viaSettings,
int defaultValue, int value, std::initializer_list<T> choices) const {
std::lock_guard<wpi::mutex> lock(m_mutex);
m_propertyData.emplace_back(wpi::make_unique<PropertyData>(
m_propertyData.emplace_back(std::make_unique<PropertyData>(
name, httpParam, viaSettings, CS_PROP_ENUM, 0, choices.size() - 1, 1,
defaultValue, value));
@@ -409,7 +408,7 @@ void HttpCameraImpl::CreateEnumProperty(
std::unique_ptr<PropertyImpl> HttpCameraImpl::CreateEmptyProperty(
const wpi::Twine& name) const {
return wpi::make_unique<PropertyData>(name);
return std::make_unique<PropertyData>(name);
}
bool HttpCameraImpl::CacheProperties(CS_Status* status) const {

View File

@@ -201,7 +201,7 @@ std::vector<std::string> PropertyContainer::GetEnumPropertyChoices(
std::unique_ptr<PropertyImpl> PropertyContainer::CreateEmptyProperty(
const wpi::Twine& name) const {
return wpi::make_unique<PropertyImpl>(name);
return std::make_unique<PropertyImpl>(name);
}
bool PropertyContainer::CacheProperties(CS_Status* status) const {

View File

@@ -10,7 +10,6 @@
#include <algorithm>
#include <cstring>
#include <wpi/STLExtras.h>
#include <wpi/json.h>
#include <wpi/timestamp.h>
@@ -514,7 +513,7 @@ void SourceImpl::ReleaseImage(std::unique_ptr<Image> image) {
std::unique_ptr<Frame::Impl> SourceImpl::AllocFrameImpl() {
std::lock_guard<wpi::mutex> lock{m_poolMutex};
if (m_framesAvail.empty()) return wpi::make_unique<Frame::Impl>(*this);
if (m_framesAvail.empty()) return std::make_unique<Frame::Impl>(*this);
auto impl = std::move(m_framesAvail.back());
m_framesAvail.pop_back();

View File

@@ -907,7 +907,7 @@ void UsbCameraImpl::DeviceCacheProperty(
std::unique_ptr<UsbCameraProperty> perProp;
if (IsPercentageProperty(rawProp->name)) {
perProp =
wpi::make_unique<UsbCameraProperty>(rawProp->name, 0, *rawProp, 0, 0);
std::make_unique<UsbCameraProperty>(rawProp->name, 0, *rawProp, 0, 0);
rawProp->name = "raw_" + perProp->name;
}
@@ -1130,7 +1130,7 @@ void UsbCameraImpl::Send(Message&& msg) const {
std::unique_ptr<PropertyImpl> UsbCameraImpl::CreateEmptyProperty(
const wpi::Twine& name) const {
return wpi::make_unique<UsbCameraProperty>(name);
return std::make_unique<UsbCameraProperty>(name);
}
bool UsbCameraImpl::CacheProperties(CS_Status* status) const {

View File

@@ -7,7 +7,6 @@
#include "UsbCameraProperty.h"
#include <wpi/STLExtras.h>
#include <wpi/SmallString.h>
#include <wpi/raw_ostream.h>
@@ -224,7 +223,7 @@ std::unique_ptr<UsbCameraProperty> UsbCameraProperty::DeviceQuery(int fd,
*id = qc_ext.id; // copy back
// We don't support array types
if (qc_ext.elems > 1 || qc_ext.nr_of_dims > 0) return nullptr;
prop = wpi::make_unique<UsbCameraProperty>(qc_ext);
prop = std::make_unique<UsbCameraProperty>(qc_ext);
}
#endif
if (!prop) {
@@ -235,7 +234,7 @@ std::unique_ptr<UsbCameraProperty> UsbCameraProperty::DeviceQuery(int fd,
rc = TryIoctl(fd, VIDIOC_QUERYCTRL, &qc);
*id = qc.id; // copy back
if (rc != 0) return nullptr;
prop = wpi::make_unique<UsbCameraProperty>(qc);
prop = std::make_unique<UsbCameraProperty>(qc);
}
// Cache enum property choices

View File

@@ -595,7 +595,7 @@ void UsbCameraImpl::DeviceCacheProperty(
std::unique_ptr<UsbCameraProperty> perProp;
if (IsPercentageProperty(rawProp->name)) {
perProp =
wpi::make_unique<UsbCameraProperty>(rawProp->name, 0, *rawProp, 0, 0);
std::make_unique<UsbCameraProperty>(rawProp->name, 0, *rawProp, 0, 0);
rawProp->name = "raw_" + perProp->name;
}