diff --git a/cameraserver/src/main/native/cpp/cameraserver/CameraServer.cpp b/cameraserver/src/main/native/cpp/cameraserver/CameraServer.cpp index 0ca17e172d..fa18a8e14b 100644 --- a/cameraserver/src/main/native/cpp/cameraserver/CameraServer.cpp +++ b/cameraserver/src/main/native/cpp/cameraserver/CameraServer.cpp @@ -491,7 +491,7 @@ CameraServer::Impl::Impl() : m_nextPort(kBasePort) { CameraServer::CameraServer() : m_impl(new Impl) {} -CameraServer::~CameraServer() {} +CameraServer::~CameraServer() = default; cs::UsbCamera CameraServer::StartAutomaticCapture() { cs::UsbCamera camera = StartAutomaticCapture(m_impl->m_defaultUsbDevice++); diff --git a/cameraserver/src/main/native/cpp/vision/VisionRunner.cpp b/cameraserver/src/main/native/cpp/vision/VisionRunner.cpp index 93de7af0bc..e9f1785a0a 100644 --- a/cameraserver/src/main/native/cpp/vision/VisionRunner.cpp +++ b/cameraserver/src/main/native/cpp/vision/VisionRunner.cpp @@ -20,7 +20,7 @@ VisionRunnerBase::VisionRunnerBase(cs::VideoSource videoSource) } // Located here and not in header due to cv::Mat forward declaration. -VisionRunnerBase::~VisionRunnerBase() {} +VisionRunnerBase::~VisionRunnerBase() = default; void VisionRunnerBase::RunOnce() { auto csShared = frc::GetCameraServerShared(); diff --git a/cscore/src/main/native/cpp/ConfigurableSourceImpl.cpp b/cscore/src/main/native/cpp/ConfigurableSourceImpl.cpp index bc31b315e7..6dedd33494 100644 --- a/cscore/src/main/native/cpp/ConfigurableSourceImpl.cpp +++ b/cscore/src/main/native/cpp/ConfigurableSourceImpl.cpp @@ -23,7 +23,7 @@ ConfigurableSourceImpl::ConfigurableSourceImpl(const wpi::Twine& name, m_videoModes.push_back(m_mode); } -ConfigurableSourceImpl::~ConfigurableSourceImpl() {} +ConfigurableSourceImpl::~ConfigurableSourceImpl() = default; void ConfigurableSourceImpl::Start() { m_notifier.NotifySource(*this, CS_SOURCE_CONNECTED); diff --git a/cscore/src/main/native/cpp/CvSourceImpl.cpp b/cscore/src/main/native/cpp/CvSourceImpl.cpp index d5a25b05c1..fa95f4400c 100644 --- a/cscore/src/main/native/cpp/CvSourceImpl.cpp +++ b/cscore/src/main/native/cpp/CvSourceImpl.cpp @@ -24,7 +24,7 @@ CvSourceImpl::CvSourceImpl(const wpi::Twine& name, wpi::Logger& logger, const VideoMode& mode) : ConfigurableSourceImpl{name, logger, notifier, telemetry, mode} {} -CvSourceImpl::~CvSourceImpl() {} +CvSourceImpl::~CvSourceImpl() = default; void CvSourceImpl::PutFrame(cv::Mat& image) { // We only support 8-bit images; convert if necessary. diff --git a/cscore/src/main/native/cpp/Frame.h b/cscore/src/main/native/cpp/Frame.h index c1ebde6205..3177d2625c 100644 --- a/cscore/src/main/native/cpp/Frame.h +++ b/cscore/src/main/native/cpp/Frame.h @@ -42,7 +42,7 @@ class Frame { }; public: - Frame() noexcept {} + Frame() noexcept = default; Frame(SourceImpl& source, const wpi::Twine& error, Time time); diff --git a/cscore/src/main/native/cpp/Instance.cpp b/cscore/src/main/native/cpp/Instance.cpp index ae1feb997d..bb2330feee 100644 --- a/cscore/src/main/native/cpp/Instance.cpp +++ b/cscore/src/main/native/cpp/Instance.cpp @@ -40,7 +40,7 @@ Instance::Instance() : telemetry(notifier), networkListener(logger, notifier) { SetDefaultLogger(); } -Instance::~Instance() {} +Instance::~Instance() = default; Instance& Instance::GetInstance() { static Instance* inst = new Instance; diff --git a/cscore/src/main/native/cpp/RawSourceImpl.cpp b/cscore/src/main/native/cpp/RawSourceImpl.cpp index 5902ff3a50..87184d2534 100644 --- a/cscore/src/main/native/cpp/RawSourceImpl.cpp +++ b/cscore/src/main/native/cpp/RawSourceImpl.cpp @@ -19,7 +19,7 @@ RawSourceImpl::RawSourceImpl(const wpi::Twine& name, wpi::Logger& logger, const VideoMode& mode) : ConfigurableSourceImpl{name, logger, notifier, telemetry, mode} {} -RawSourceImpl::~RawSourceImpl() {} +RawSourceImpl::~RawSourceImpl() = default; void RawSourceImpl::PutFrame(const CS_RawFrame& image) { int type; diff --git a/cscore/src/main/native/cpp/Telemetry.cpp b/cscore/src/main/native/cpp/Telemetry.cpp index c57b55b461..751ef44cf5 100644 --- a/cscore/src/main/native/cpp/Telemetry.cpp +++ b/cscore/src/main/native/cpp/Telemetry.cpp @@ -43,7 +43,7 @@ int64_t Telemetry::Thread::GetValue(CS_Handle handle, CS_TelemetryKind kind, return it->getSecond(); } -Telemetry::~Telemetry() {} +Telemetry::~Telemetry() = default; void Telemetry::Start() { m_owner.Start(m_notifier); diff --git a/cscore/src/main/native/include/cscore_oo.h b/cscore/src/main/native/include/cscore_oo.h index abb6ddecae..e94cdca383 100644 --- a/cscore/src/main/native/include/cscore_oo.h +++ b/cscore/src/main/native/include/cscore_oo.h @@ -48,7 +48,7 @@ class VideoProperty { kEnum = CS_PROP_ENUM }; - VideoProperty() {} + VideoProperty() = default; std::string GetName() const; @@ -124,7 +124,7 @@ class VideoSource { kConnectionForceClose = CS_CONNECTION_FORCE_CLOSE }; - VideoSource() noexcept {} + VideoSource() noexcept = default; VideoSource(const VideoSource& source); VideoSource(VideoSource&& other) noexcept; VideoSource& operator=(VideoSource other) noexcept; @@ -733,7 +733,7 @@ class VideoSink { kCv = CS_SINK_CV }; - VideoSink() noexcept {} + VideoSink() noexcept = default; VideoSink(const VideoSink& sink); VideoSink(VideoSink&& sink) noexcept; VideoSink& operator=(VideoSink other) noexcept; @@ -1008,7 +1008,7 @@ class VideoEvent : public RawEvent { */ class VideoListener { public: - VideoListener() {} + VideoListener() = default; /** * Create an event listener. diff --git a/cscore/src/main/native/linux/UsbCameraBuffer.h b/cscore/src/main/native/linux/UsbCameraBuffer.h index f10d4e4177..91fd588ada 100644 --- a/cscore/src/main/native/linux/UsbCameraBuffer.h +++ b/cscore/src/main/native/linux/UsbCameraBuffer.h @@ -13,7 +13,7 @@ namespace cs { class UsbCameraBuffer { public: - UsbCameraBuffer() noexcept {} + UsbCameraBuffer() noexcept = default; UsbCameraBuffer(UsbCameraBuffer&& other) noexcept : UsbCameraBuffer() { swap(*this, other); } diff --git a/cscore/src/main/native/osx/NetworkListener.cpp b/cscore/src/main/native/osx/NetworkListener.cpp index 5851afe7ae..3d77fba9cb 100644 --- a/cscore/src/main/native/osx/NetworkListener.cpp +++ b/cscore/src/main/native/osx/NetworkListener.cpp @@ -10,7 +10,7 @@ class NetworkListener::Impl {}; NetworkListener::NetworkListener(wpi::Logger& logger, Notifier& notifier) {} -NetworkListener::~NetworkListener() {} +NetworkListener::~NetworkListener() = default; void NetworkListener::Start() {} diff --git a/cscore/src/main/native/windows/COMCreators.h b/cscore/src/main/native/windows/COMCreators.h index 60ccf088a9..84cb982249 100644 --- a/cscore/src/main/native/windows/COMCreators.h +++ b/cscore/src/main/native/windows/COMCreators.h @@ -39,7 +39,7 @@ class SourceReaderCB : public IMFSourceReaderCallback { private: // Destructor is private. Caller should call Release. - virtual ~SourceReaderCB() {} + virtual ~SourceReaderCB() = default; void NotifyError(HRESULT hr); ULONG m_nRefCount; diff --git a/cscore/src/test/native/cpp/CameraSourceTest.cpp b/cscore/src/test/native/cpp/CameraSourceTest.cpp index c963757d48..18787658d9 100644 --- a/cscore/src/test/native/cpp/CameraSourceTest.cpp +++ b/cscore/src/test/native/cpp/CameraSourceTest.cpp @@ -9,7 +9,7 @@ namespace cs { class CameraSourceTest : public ::testing::Test { protected: - CameraSourceTest() {} + CameraSourceTest() = default; }; TEST_F(CameraSourceTest, HTTPCamera) { diff --git a/glass/src/lib/native/cpp/other/Plot.cpp b/glass/src/lib/native/cpp/other/Plot.cpp index 23b720ab4e..5514f74ec8 100644 --- a/glass/src/lib/native/cpp/other/Plot.cpp +++ b/glass/src/lib/native/cpp/other/Plot.cpp @@ -889,7 +889,7 @@ PlotProvider::PlotProvider(const wpi::Twine& iniName) m_plotSaver{iniName, this, false}, m_seriesSaver{iniName + "Series", this, true} {} -PlotProvider::~PlotProvider() {} +PlotProvider::~PlotProvider() = default; void PlotProvider::GlobalInit() { WindowManager::GlobalInit(); diff --git a/glass/src/libnt/native/cpp/NTField2D.cpp b/glass/src/libnt/native/cpp/NTField2D.cpp index d3e986708e..620bb05865 100644 --- a/glass/src/libnt/native/cpp/NTField2D.cpp +++ b/glass/src/libnt/native/cpp/NTField2D.cpp @@ -184,7 +184,7 @@ NTField2DModel::NTField2DModel(NT_Inst inst, wpi::StringRef path) NT_NOTIFY_UPDATE | NT_NOTIFY_IMMEDIATE); } -NTField2DModel::~NTField2DModel() {} +NTField2DModel::~NTField2DModel() = default; void NTField2DModel::Update() { for (auto&& event : m_nt.PollListener()) { diff --git a/ntcore/src/main/native/cpp/Message.h b/ntcore/src/main/native/cpp/Message.h index fdef274c52..7754bb584c 100644 --- a/ntcore/src/main/native/cpp/Message.h +++ b/ntcore/src/main/native/cpp/Message.h @@ -38,7 +38,7 @@ class Message { }; typedef std::function GetEntryTypeFunc; - Message() {} + Message() = default; Message(MsgType type, const private_init&) : m_type(type) {} MsgType type() const { return m_type; } diff --git a/ntcore/src/main/native/cpp/SequenceNumber.h b/ntcore/src/main/native/cpp/SequenceNumber.h index 96f4c9d829..719d85c9f9 100644 --- a/ntcore/src/main/native/cpp/SequenceNumber.h +++ b/ntcore/src/main/native/cpp/SequenceNumber.h @@ -10,7 +10,7 @@ namespace nt { /* A sequence number per RFC 1982 */ class SequenceNumber { public: - SequenceNumber() {} + SequenceNumber() = default; explicit SequenceNumber(unsigned int value) : m_value(value) {} unsigned int value() const { return m_value; } diff --git a/ntcore/src/main/native/include/networktables/RpcCall.h b/ntcore/src/main/native/include/networktables/RpcCall.h index f878954026..dd4991bc5f 100644 --- a/ntcore/src/main/native/include/networktables/RpcCall.h +++ b/ntcore/src/main/native/include/networktables/RpcCall.h @@ -23,7 +23,7 @@ class RpcCall final { /** * Construct invalid instance. */ - RpcCall() {} + RpcCall() = default; /** * Construct from native handles. diff --git a/ntcore/src/main/native/include/ntcore_cpp.h b/ntcore/src/main/native/include/ntcore_cpp.h index cb8f1c1c78..1700a2b88f 100644 --- a/ntcore/src/main/native/include/ntcore_cpp.h +++ b/ntcore/src/main/native/include/ntcore_cpp.h @@ -130,7 +130,7 @@ struct RpcDefinition { /** NetworkTables Remote Procedure Call (Server Side) */ class RpcAnswer { public: - RpcAnswer() {} + RpcAnswer() = default; RpcAnswer(NT_Entry entry_, NT_RpcCall call_, StringRef name_, StringRef params_, const ConnectionInfo& conn_) : entry(entry_), call(call_), name(name_), params(params_), conn(conn_) {} @@ -176,7 +176,7 @@ class RpcAnswer { /** NetworkTables Entry Notification */ class EntryNotification { public: - EntryNotification() {} + EntryNotification() = default; EntryNotification(NT_EntryListener listener_, NT_Entry entry_, StringRef name_, std::shared_ptr value_, unsigned int flags_) @@ -217,7 +217,7 @@ class EntryNotification { /** NetworkTables Connection Notification */ class ConnectionNotification { public: - ConnectionNotification() {} + ConnectionNotification() = default; ConnectionNotification(NT_ConnectionListener listener_, bool connected_, const ConnectionInfo& conn_) : listener(listener_), connected(connected_), conn(conn_) {} @@ -243,7 +243,7 @@ class ConnectionNotification { /** NetworkTables log message. */ class LogMessage { public: - LogMessage() {} + LogMessage() = default; LogMessage(NT_Logger logger_, unsigned int level_, const char* filename_, unsigned int line_, StringRef message_) : logger(logger_), diff --git a/simulation/halsim_ws_core/src/main/native/include/WSBaseProvider.h b/simulation/halsim_ws_core/src/main/native/include/WSBaseProvider.h index aabd29dde4..a0c47b5f95 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSBaseProvider.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSBaseProvider.h @@ -18,7 +18,7 @@ class HALSimWSBaseProvider { public: explicit HALSimWSBaseProvider(const std::string& key, const std::string& type = ""); - virtual ~HALSimWSBaseProvider() {} + virtual ~HALSimWSBaseProvider() = default; HALSimWSBaseProvider(const HALSimWSBaseProvider&) = delete; HALSimWSBaseProvider& operator=(const HALSimWSBaseProvider&) = delete; diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProviderContainer.h b/simulation/halsim_ws_core/src/main/native/include/WSProviderContainer.h index 4d28e9035b..5ea8cb693f 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProviderContainer.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProviderContainer.h @@ -19,7 +19,7 @@ class ProviderContainer { using ProviderPtr = std::shared_ptr; using IterFn = std::function; - ProviderContainer() {} + ProviderContainer() = default; ProviderContainer(const ProviderContainer&) = delete; ProviderContainer& operator=(const ProviderContainer&) = delete; diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp index 815bb6b3ef..8b5737fc04 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp @@ -8,7 +8,7 @@ using namespace frc2; -Trigger::Trigger(const Trigger& other) : m_isActive(other.m_isActive) {} +Trigger::Trigger(const Trigger& other) = default; Trigger Trigger::WhenActive(Command* command, bool interruptible) { CommandScheduler::GetInstance().AddButton( diff --git a/wpilibc/src/main/native/cpp/shuffleboard/ShuffleboardInstance.cpp b/wpilibc/src/main/native/cpp/shuffleboard/ShuffleboardInstance.cpp index 15b84cfc00..25daba291f 100644 --- a/wpilibc/src/main/native/cpp/shuffleboard/ShuffleboardInstance.cpp +++ b/wpilibc/src/main/native/cpp/shuffleboard/ShuffleboardInstance.cpp @@ -29,7 +29,7 @@ ShuffleboardInstance::ShuffleboardInstance(nt::NetworkTableInstance ntInstance) HAL_Report(HALUsageReporting::kResourceType_Shuffleboard, 0); } -ShuffleboardInstance::~ShuffleboardInstance() {} +ShuffleboardInstance::~ShuffleboardInstance() = default; frc::ShuffleboardTab& ShuffleboardInstance::GetTab(wpi::StringRef title) { if (m_impl->tabs.find(title) == m_impl->tabs.end()) { diff --git a/wpilibc/src/main/native/cppcs/RobotBase.cpp b/wpilibc/src/main/native/cppcs/RobotBase.cpp index 4cab99cfd0..d0b23faa9e 100644 --- a/wpilibc/src/main/native/cppcs/RobotBase.cpp +++ b/wpilibc/src/main/native/cppcs/RobotBase.cpp @@ -220,7 +220,7 @@ RobotBase::RobotBase() : m_ds(DriverStation::GetInstance()) { RobotBase::RobotBase(RobotBase&&) noexcept : m_ds(DriverStation::GetInstance()) {} -RobotBase::~RobotBase() {} +RobotBase::~RobotBase() = default; RobotBase& RobotBase::operator=(RobotBase&&) noexcept { return *this; diff --git a/wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.cpp b/wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.cpp index af94db9d52..19de34f3da 100644 --- a/wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.cpp +++ b/wpilibcExamples/src/main/cpp/commands/emptyclass/ReplaceMeEmptyClass.cpp @@ -4,4 +4,4 @@ #include "ReplaceMeEmptyClass.h" -ReplaceMeEmptyClass::ReplaceMeEmptyClass() {} +ReplaceMeEmptyClass::ReplaceMeEmptyClass() = default; diff --git a/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.cpp b/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.cpp index 5af1b5bcd9..8d0ede06f3 100644 --- a/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.cpp +++ b/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.cpp @@ -4,7 +4,7 @@ #include "ReplaceMeSubsystem2.h" -ReplaceMeSubsystem2::ReplaceMeSubsystem2() {} +ReplaceMeSubsystem2::ReplaceMeSubsystem2() = default; // This method will be called once per scheduler run void ReplaceMeSubsystem2::Periodic() {} diff --git a/wpilibcExamples/src/main/cpp/commands/trigger/ReplaceMeTrigger.cpp b/wpilibcExamples/src/main/cpp/commands/trigger/ReplaceMeTrigger.cpp index bdea9ecbfe..3c563ffeb8 100644 --- a/wpilibcExamples/src/main/cpp/commands/trigger/ReplaceMeTrigger.cpp +++ b/wpilibcExamples/src/main/cpp/commands/trigger/ReplaceMeTrigger.cpp @@ -4,7 +4,7 @@ #include "ReplaceMeTrigger.h" -ReplaceMeTrigger::ReplaceMeTrigger() {} +ReplaceMeTrigger::ReplaceMeTrigger() = default; bool ReplaceMeTrigger::Get() { return false; diff --git a/wpimath/src/test/native/cpp/UnitsTest.cpp b/wpimath/src/test/native/cpp/UnitsTest.cpp index fce3ad7342..5f27dc6b45 100644 --- a/wpimath/src/test/native/cpp/UnitsTest.cpp +++ b/wpimath/src/test/native/cpp/UnitsTest.cpp @@ -93,64 +93,64 @@ namespace { class TypeTraits : public ::testing::Test { protected: - TypeTraits() {} - ~TypeTraits() override {} + TypeTraits() = default; + ~TypeTraits() override = default; void SetUp() override {} void TearDown() override {} }; class UnitManipulators : public ::testing::Test { protected: - UnitManipulators() {} - ~UnitManipulators() override {} + UnitManipulators() = default; + ~UnitManipulators() override = default; void SetUp() override {} void TearDown() override {} }; class UnitContainer : public ::testing::Test { protected: - UnitContainer() {} - ~UnitContainer() override {} + UnitContainer() = default; + ~UnitContainer() override = default; void SetUp() override {} void TearDown() override {} }; class UnitConversion : public ::testing::Test { protected: - UnitConversion() {} - ~UnitConversion() override {} + UnitConversion() = default; + ~UnitConversion() override = default; void SetUp() override {} void TearDown() override {} }; class UnitMath : public ::testing::Test { protected: - UnitMath() {} - ~UnitMath() override {} + UnitMath() = default; + ~UnitMath() override = default; void SetUp() override {} void TearDown() override {} }; class CompileTimeArithmetic : public ::testing::Test { protected: - CompileTimeArithmetic() {} - ~CompileTimeArithmetic() override {} + CompileTimeArithmetic() = default; + ~CompileTimeArithmetic() override = default; void SetUp() override {} void TearDown() override {} }; class Constexpr : public ::testing::Test { protected: - Constexpr() {} - ~Constexpr() override {} + Constexpr() = default; + ~Constexpr() override = default; void SetUp() override {} void TearDown() override {} }; class CaseStudies : public ::testing::Test { protected: - CaseStudies() {} - ~CaseStudies() override {} + CaseStudies() = default; + ~CaseStudies() override = default; void SetUp() override {} void TearDown() override {} diff --git a/wpiutil/src/main/native/cpp/WebSocket.cpp b/wpiutil/src/main/native/cpp/WebSocket.cpp index 7c4c775896..11e3391687 100644 --- a/wpiutil/src/main/native/cpp/WebSocket.cpp +++ b/wpiutil/src/main/native/cpp/WebSocket.cpp @@ -92,7 +92,7 @@ WebSocket::WebSocket(uv::Stream& stream, bool server, const private_init&) [this]() { Terminate(1006, "remote end closed connection"); }); } -WebSocket::~WebSocket() {} +WebSocket::~WebSocket() = default; std::shared_ptr WebSocket::CreateClient( uv::Stream& stream, const Twine& uri, const Twine& host, diff --git a/wpiutil/src/main/native/include/wpi/uv/Error.h b/wpiutil/src/main/native/include/wpi/uv/Error.h index 9b063dc425..9a732cbcb2 100644 --- a/wpiutil/src/main/native/include/wpi/uv/Error.h +++ b/wpiutil/src/main/native/include/wpi/uv/Error.h @@ -15,7 +15,7 @@ namespace uv { */ class Error { public: - Error() {} + Error() = default; explicit Error(int err) : m_err(err) {} /**