mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
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:
@@ -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);
|
||||
},
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user