diff --git a/cpp/include/DataStorm/InternalT.h b/cpp/include/DataStorm/InternalT.h index b3c509c2082..17d48a51fe5 100644 --- a/cpp/include/DataStorm/InternalT.h +++ b/cpp/include/DataStorm/InternalT.h @@ -464,7 +464,7 @@ namespace DataStormI class FilterFactoryT final : public FilterFactory, public AbstractFactoryT> { public: - FilterFactoryT() {} + FilterFactoryT() = default; [[nodiscard]] std::shared_ptr get(std::int64_t id) const final { diff --git a/cpp/include/Ice/MetricsObserverI.h b/cpp/include/Ice/MetricsObserverI.h index 401879a0b1c..7221ac9b3ec 100644 --- a/cpp/include/Ice/MetricsObserverI.h +++ b/cpp/include/Ice/MetricsObserverI.h @@ -21,7 +21,7 @@ namespace IceInternal class StopWatch { public: - StopWatch() {} + StopWatch() = default; void start() { _start = std::chrono::steady_clock::now(); } @@ -52,7 +52,7 @@ namespace IceMX template class MetricsHelperT { public: - virtual ~MetricsHelperT() {} + virtual ~MetricsHelperT() = default; virtual std::string operator()(const std::string&) const = 0; @@ -69,7 +69,7 @@ namespace IceMX public: Resolver(std::string name) : _name(std::move(name)) {} - virtual ~Resolver() {} + virtual ~Resolver() = default; virtual std::string operator()(const Helper* h) const = 0; @@ -78,7 +78,7 @@ namespace IceMX }; public: - AttributeResolverT() : _default(nullptr) {} + AttributeResolverT() = default; ~AttributeResolverT() { @@ -289,7 +289,7 @@ namespace IceMX static std::string toString(bool v) { return v ? "true" : "false"; } std::map _attributes; - std::string (Helper::*_default)(const std::string&) const; + std::string (Helper::*_default)(const std::string&) const = nullptr; }; }; @@ -331,7 +331,7 @@ namespace IceMX using EntryPtrType = typename IceInternal::MetricsMapT::EntryTPtr; using EntrySeqType = std::vector; - ObserverT() : _previousDelay(0) {} + ObserverT() = default; void attach() override { @@ -430,7 +430,7 @@ namespace IceMX private: EntrySeqType _objects; IceInternal::StopWatch _watch; - std::chrono::microseconds _previousDelay; + std::chrono::microseconds _previousDelay{0}; }; template class ObserverFactoryT : public Updater diff --git a/cpp/include/Ice/StringConverter.h b/cpp/include/Ice/StringConverter.h index 43bd507b4ba..2a1f1ca7899 100644 --- a/cpp/include/Ice/StringConverter.h +++ b/cpp/include/Ice/StringConverter.h @@ -56,7 +56,7 @@ namespace Ice virtual void fromUTF8(const std::byte* sourceStart, const std::byte* sourceEnd, std::basic_string& target) const = 0; - virtual ~BasicStringConverter() {} + virtual ~BasicStringConverter() = default; }; #if defined(__clang__) diff --git a/cpp/src/Glacier2/Glacier2Router.cpp b/cpp/src/Glacier2/Glacier2Router.cpp index 83c4513bdca..32eeeadfcf6 100644 --- a/cpp/src/Glacier2/Glacier2Router.cpp +++ b/cpp/src/Glacier2/Glacier2Router.cpp @@ -84,7 +84,7 @@ namespace }; -RouterService::RouterService() {} +RouterService::RouterService() = default; bool RouterService::start(int argc, char* argv[], int& status) diff --git a/cpp/src/Glacier2/ProxyVerifier.cpp b/cpp/src/Glacier2/ProxyVerifier.cpp index 2f5c3d09bd7..f5c59cb9eca 100644 --- a/cpp/src/Glacier2/ProxyVerifier.cpp +++ b/cpp/src/Glacier2/ProxyVerifier.cpp @@ -99,7 +99,7 @@ namespace Glacier2 class AddressMatcher { public: - virtual ~AddressMatcher() {} + virtual ~AddressMatcher() = default; virtual bool match(const string&, string::size_type& pos) = 0; [[nodiscard]] virtual const char* toString() const = 0; diff --git a/cpp/src/Glacier2/ProxyVerifier.h b/cpp/src/Glacier2/ProxyVerifier.h index da8791a0459..0578220935e 100644 --- a/cpp/src/Glacier2/ProxyVerifier.h +++ b/cpp/src/Glacier2/ProxyVerifier.h @@ -17,7 +17,7 @@ namespace Glacier2 class ProxyRule { public: - virtual ~ProxyRule() {} + virtual ~ProxyRule() = default; // // Checks to see if the proxy passes. diff --git a/cpp/src/Ice/CollocatedRequestHandler.cpp b/cpp/src/Ice/CollocatedRequestHandler.cpp index a14b821ab0d..86857a145b1 100644 --- a/cpp/src/Ice/CollocatedRequestHandler.cpp +++ b/cpp/src/Ice/CollocatedRequestHandler.cpp @@ -43,7 +43,7 @@ CollocatedRequestHandler::CollocatedRequestHandler(const ReferencePtr& ref, cons { } -CollocatedRequestHandler::~CollocatedRequestHandler() {} +CollocatedRequestHandler::~CollocatedRequestHandler() = default; AsyncStatus CollocatedRequestHandler::sendAsyncRequest(const ProxyOutgoingAsyncBasePtr& outAsync) diff --git a/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp b/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp index 92ed2466af5..447ab18bb07 100644 --- a/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +++ b/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp @@ -13,10 +13,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; -CommunicatorFlushBatchAsync::~CommunicatorFlushBatchAsync() -{ - // Out of line to avoid weak vtable -} +CommunicatorFlushBatchAsync::~CommunicatorFlushBatchAsync() = default; // Out of line to avoid weak vtable CommunicatorFlushBatchAsync::CommunicatorFlushBatchAsync(const InstancePtr& instance) : OutgoingAsyncBase(instance) { diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp index 036964b6006..602f6225c4b 100644 --- a/cpp/src/Ice/Connection.cpp +++ b/cpp/src/Ice/Connection.cpp @@ -8,13 +8,13 @@ using namespace Ice; using namespace std; // Implement virtual destructors out of line to avoid weak vtables. -Ice::ConnectionInfo::~ConnectionInfo() {} -Ice::TCPConnectionInfo::~TCPConnectionInfo() {} -Ice::UDPConnectionInfo::~UDPConnectionInfo() {} -Ice::WSConnectionInfo::~WSConnectionInfo() {} -Ice::IAPConnectionInfo::~IAPConnectionInfo() {} +Ice::ConnectionInfo::~ConnectionInfo() = default; +Ice::TCPConnectionInfo::~TCPConnectionInfo() = default; +Ice::UDPConnectionInfo::~UDPConnectionInfo() = default; +Ice::WSConnectionInfo::~WSConnectionInfo() = default; +Ice::IAPConnectionInfo::~IAPConnectionInfo() = default; -Ice::Connection::~Connection() {} +Ice::Connection::~Connection() = default; void Ice::Connection::flushBatchRequests(CompressBatch compress) diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp index 290151848d3..b6710fdd0f0 100644 --- a/cpp/src/Ice/DynamicLibrary.cpp +++ b/cpp/src/Ice/DynamicLibrary.cpp @@ -19,24 +19,9 @@ using namespace std; IceInternal::DynamicLibrary::DynamicLibrary() : _hnd(nullptr) {} -IceInternal::DynamicLibrary::~DynamicLibrary() -{ - /* - * Closing the library here can cause a crash at program exit if - * the application holds references to library resources in global - * or static variables. Instead, we let the process discard the - * library. - * - if(_hnd != 0) - { -#ifdef _WIN32 - FreeLibrary(_hnd); -#else - dlclose(_hnd); -#endif - } - */ -} +// Closing the library here can cause a crash at program exit if the application holds references to library resources +// in global or static variables. Instead, we let the process discard the library. +IceInternal::DynamicLibrary::~DynamicLibrary() = default; IceInternal::DynamicLibrary::symbol_type IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIceVersion) diff --git a/cpp/src/Ice/EndpointFactory.cpp b/cpp/src/Ice/EndpointFactory.cpp index 3ae9c4648ab..59673154977 100644 --- a/cpp/src/Ice/EndpointFactory.cpp +++ b/cpp/src/Ice/EndpointFactory.cpp @@ -11,9 +11,9 @@ using namespace std; using namespace Ice; using namespace IceInternal; -IceInternal::EndpointFactory::EndpointFactory() {} +IceInternal::EndpointFactory::EndpointFactory() = default; -IceInternal::EndpointFactory::~EndpointFactory() {} +IceInternal::EndpointFactory::~EndpointFactory() = default; void IceInternal::EndpointFactory::initialize() diff --git a/cpp/src/Ice/EndpointI.cpp b/cpp/src/Ice/EndpointI.cpp index 70229a38553..65d902d755b 100644 --- a/cpp/src/Ice/EndpointI.cpp +++ b/cpp/src/Ice/EndpointI.cpp @@ -9,15 +9,9 @@ using namespace std; -Ice::Endpoint::~Endpoint() -{ - // out of line to avoid weak vtable -} +Ice::Endpoint::~Endpoint() = default; // Out of line to avoid weak vtable -Ice::EndpointInfo::~EndpointInfo() -{ - // out of line to avoid weak vtable -} +Ice::EndpointInfo::~EndpointInfo() = default; // Out of line to avoid weak vtable int16_t Ice::EndpointInfo::type() const noexcept @@ -37,15 +31,15 @@ Ice::EndpointInfo::secure() const noexcept return underlying ? underlying->secure() : false; } -Ice::TCPEndpointInfo::~TCPEndpointInfo() {} +Ice::TCPEndpointInfo::~TCPEndpointInfo() = default; -Ice::UDPEndpointInfo::~UDPEndpointInfo() {} +Ice::UDPEndpointInfo::~UDPEndpointInfo() = default; -Ice::WSEndpointInfo::~WSEndpointInfo() {} +Ice::WSEndpointInfo::~WSEndpointInfo() = default; -Ice::IAPEndpointInfo::~IAPEndpointInfo() {} +Ice::IAPEndpointInfo::~IAPEndpointInfo() = default; -Ice::OpaqueEndpointInfo::~OpaqueEndpointInfo() {} +Ice::OpaqueEndpointInfo::~OpaqueEndpointInfo() = default; void IceInternal::EndpointI::streamWrite(Ice::OutputStream* s) const diff --git a/cpp/src/Ice/EventHandler.cpp b/cpp/src/Ice/EventHandler.cpp index 3dcfbd12428..a9d4b52426c 100644 --- a/cpp/src/Ice/EventHandler.cpp +++ b/cpp/src/Ice/EventHandler.cpp @@ -24,4 +24,4 @@ IceInternal::EventHandler::EventHandler() { } -IceInternal::EventHandler::~EventHandler() {} +IceInternal::EventHandler::~EventHandler() = default; diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp index 3b8e1c0a37b..b9ac5d2f5fb 100644 --- a/cpp/src/Ice/Initialize.cpp +++ b/cpp/src/Ice/Initialize.cpp @@ -309,7 +309,7 @@ Ice::registerPluginFactory(std::string name, PluginFactory factory, bool loadOnI // CommunicatorHolder // -Ice::CommunicatorHolder::CommunicatorHolder() {} +Ice::CommunicatorHolder::CommunicatorHolder() = default; Ice::CommunicatorHolder::CommunicatorHolder(CommunicatorPtr communicator) : _communicator(std::move(communicator)) {} diff --git a/cpp/src/Ice/LocatorInfo.cpp b/cpp/src/Ice/LocatorInfo.cpp index 7011dbec3b3..2f0ac5eaf76 100644 --- a/cpp/src/Ice/LocatorInfo.cpp +++ b/cpp/src/Ice/LocatorInfo.cpp @@ -148,7 +148,7 @@ IceInternal::LocatorManager::get(const LocatorPrx& loc) return _tableHint->second; } -IceInternal::LocatorTable::LocatorTable() {} +IceInternal::LocatorTable::LocatorTable() = default; void IceInternal::LocatorTable::clear() diff --git a/cpp/src/Ice/MetricsAdminI.cpp b/cpp/src/Ice/MetricsAdminI.cpp index dcfc3c3e36d..2677aec451b 100644 --- a/cpp/src/Ice/MetricsAdminI.cpp +++ b/cpp/src/Ice/MetricsAdminI.cpp @@ -95,10 +95,7 @@ MetricsMapI::RegExp::match(const string& value) return regex_match(value, _regex); } -MetricsMapI::~MetricsMapI() -{ - // Out of line to avoid weak vtable -} +MetricsMapI::~MetricsMapI() = default; // Out of line to avoid weak vtable MetricsMapI::MetricsMapI(const std::string& mapPrefix, const PropertiesPtr& properties) : _properties(properties->getPropertiesForPrefix(mapPrefix)), @@ -169,10 +166,7 @@ MetricsMapI::getProperties() const return _properties; } -MetricsMapFactory::~MetricsMapFactory() -{ - // Out of line to avoid weak vtable -} +MetricsMapFactory::~MetricsMapFactory() = default; // Out of line to avoid weak vtable MetricsMapFactory::MetricsMapFactory(Updater* updater) : _updater(updater) {} @@ -343,7 +337,7 @@ MetricsAdminI::MetricsAdminI(PropertiesPtr properties, LoggerPtr logger) updateViews(); } -MetricsAdminI::~MetricsAdminI() {} +MetricsAdminI::~MetricsAdminI() = default; void MetricsAdminI::destroy() diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp index 798cbccbe74..55210fe681a 100644 --- a/cpp/src/Ice/Network.cpp +++ b/cpp/src/Ice/Network.cpp @@ -690,15 +690,9 @@ namespace } } -ReadyCallback::~ReadyCallback() -{ - // Out of line to avoid weak vtable -} +ReadyCallback::~ReadyCallback() = default; // Out of line to avoid weak vtable -NativeInfo::~NativeInfo() -{ - // Out of line to avoid weak vtable -} +NativeInfo::~NativeInfo() = default; // Out of line to avoid weak vtable void NativeInfo::setReadyCallback(const ReadyCallbackPtr& callback) diff --git a/cpp/src/Ice/NetworkProxy.cpp b/cpp/src/Ice/NetworkProxy.cpp index 82de734d332..c1cf0ce93c3 100644 --- a/cpp/src/Ice/NetworkProxy.cpp +++ b/cpp/src/Ice/NetworkProxy.cpp @@ -10,10 +10,7 @@ using namespace std; using namespace IceInternal; -NetworkProxy::~NetworkProxy() -{ - // Out of line to avoid weak vtable -} +NetworkProxy::~NetworkProxy() = default; // Out of line to avoid weak vtable namespace { diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index b876c95837a..e32e769e1d9 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -27,10 +27,7 @@ using namespace IceInternal; const unsigned char OutgoingAsyncBase::OK = 0x1; const unsigned char OutgoingAsyncBase::Sent = 0x2; -OutgoingAsyncCompletionCallback::~OutgoingAsyncCompletionCallback() -{ - // Out of line to avoid weak vtable -} +OutgoingAsyncCompletionCallback::~OutgoingAsyncCompletionCallback() = default; // Out of line to avoid weak vtable bool OutgoingAsyncBase::sent() @@ -419,7 +416,7 @@ ProxyOutgoingAsyncBase::ProxyOutgoingAsyncBase(ObjectPrx proxy) { } -ProxyOutgoingAsyncBase::~ProxyOutgoingAsyncBase() {} +ProxyOutgoingAsyncBase::~ProxyOutgoingAsyncBase() = default; void ProxyOutgoingAsyncBase::invokeImpl(bool userThread) diff --git a/cpp/src/Ice/OutputUtil.cpp b/cpp/src/Ice/OutputUtil.cpp index 02cbe445202..50d3fc5e1cd 100644 --- a/cpp/src/Ice/OutputUtil.cpp +++ b/cpp/src/Ice/OutputUtil.cpp @@ -57,7 +57,7 @@ IceInternal::OutputBase::OutputBase(const string& s) open(s); } -IceInternal::OutputBase::~OutputBase() {} +IceInternal::OutputBase::~OutputBase() = default; void IceInternal::OutputBase::open(const string& s) diff --git a/cpp/src/Ice/PropertiesAdminI.cpp b/cpp/src/Ice/PropertiesAdminI.cpp index dd6bc6f9667..66b8e6c7d86 100644 --- a/cpp/src/Ice/PropertiesAdminI.cpp +++ b/cpp/src/Ice/PropertiesAdminI.cpp @@ -16,10 +16,7 @@ namespace const char* traceCategory = "Admin.Properties"; } -NativePropertiesAdmin::~NativePropertiesAdmin() -{ - // Out of line to avoid weak vtable -} +NativePropertiesAdmin::~NativePropertiesAdmin() = default; // Out of line to avoid weak vtable namespace IceInternal { diff --git a/cpp/src/Ice/ProtocolInstance.cpp b/cpp/src/Ice/ProtocolInstance.cpp index efef48e8fb2..8941398a050 100644 --- a/cpp/src/Ice/ProtocolInstance.cpp +++ b/cpp/src/Ice/ProtocolInstance.cpp @@ -14,10 +14,8 @@ using namespace std; using namespace Ice; using namespace IceInternal; -IceInternal::ProtocolInstance::~ProtocolInstance() -{ - // Out of line to avoid weak vtable -} +// Out of line to avoid weak vtable +IceInternal::ProtocolInstance::~ProtocolInstance() = default; IceInternal::ProtocolInstance::ProtocolInstance(const CommunicatorPtr& com, int16_t type, string protocol, bool secure) : _instance(getInstance(com)), diff --git a/cpp/src/Ice/ProtocolPluginFacade.cpp b/cpp/src/Ice/ProtocolPluginFacade.cpp index a3aa8b02db6..c73dc35edc1 100644 --- a/cpp/src/Ice/ProtocolPluginFacade.cpp +++ b/cpp/src/Ice/ProtocolPluginFacade.cpp @@ -13,10 +13,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; -IceInternal::ProtocolPluginFacade::~ProtocolPluginFacade() -{ - // Out of line to avoid weak vtable -} +IceInternal::ProtocolPluginFacade::~ProtocolPluginFacade() = default; // Out of line to avoid weak vtable ProtocolPluginFacadePtr IceInternal::getProtocolPluginFacade(const CommunicatorPtr& communicator) diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 829404b333a..492cb180095 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -741,12 +741,6 @@ IceInternal::FixedReference::clone() const return make_shared(*this); } -IceInternal::FixedReference::FixedReference(const FixedReference& r) - : Reference(r), - _fixedConnection(r._fixedConnection) -{ -} - IceInternal::RoutableReference::RoutableReference( InstancePtr instance, CommunicatorPtr communicator, diff --git a/cpp/src/Ice/Reference.h b/cpp/src/Ice/Reference.h index 3df01fdd76f..008e484065c 100644 --- a/cpp/src/Ice/Reference.h +++ b/cpp/src/Ice/Reference.h @@ -188,7 +188,7 @@ namespace IceInternal std::chrono::milliseconds, Ice::Context); - FixedReference(const FixedReference&); + FixedReference(const FixedReference&) = default; [[nodiscard]] std::vector getEndpoints() const final; [[nodiscard]] std::string getAdapterId() const final; diff --git a/cpp/src/Ice/SHA1.cpp b/cpp/src/Ice/SHA1.cpp index 5187ee2c4fd..44ea4cd913e 100644 --- a/cpp/src/Ice/SHA1.cpp +++ b/cpp/src/Ice/SHA1.cpp @@ -141,7 +141,7 @@ IceInternal::SHA1::Hasher::finalize(vector& md) IceInternal::SHA1::SHA1() : _hasher(new Hasher()) {} -IceInternal::SHA1::~SHA1() {} +IceInternal::SHA1::~SHA1() = default; void IceInternal::SHA1::update(const unsigned char* data, std::size_t length) diff --git a/cpp/src/Ice/SSL/OpenSSLEngine.cpp b/cpp/src/Ice/SSL/OpenSSLEngine.cpp index aeffb8861a4..07227212943 100644 --- a/cpp/src/Ice/SSL/OpenSSLEngine.cpp +++ b/cpp/src/Ice/SSL/OpenSSLEngine.cpp @@ -73,7 +73,7 @@ OpenSSL::SSLEngine::SSLEngine(const IceInternal::InstancePtr& instance) : Ice::S { } -OpenSSL::SSLEngine::~SSLEngine() {} +OpenSSL::SSLEngine::~SSLEngine() = default; void OpenSSL::SSLEngine::initialize() diff --git a/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp b/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp index b41ea776afb..2b8dc57e014 100644 --- a/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +++ b/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp @@ -741,7 +741,7 @@ OpenSSL::TransceiverI::TransceiverI( { } -OpenSSL::TransceiverI::~TransceiverI() {} +OpenSSL::TransceiverI::~TransceiverI() = default; bool OpenSSL::TransceiverI::receive() diff --git a/cpp/src/Ice/SSL/SSLAcceptorI.cpp b/cpp/src/Ice/SSL/SSLAcceptorI.cpp index 1b43bee5a91..64a765365e2 100644 --- a/cpp/src/Ice/SSL/SSLAcceptorI.cpp +++ b/cpp/src/Ice/SSL/SSLAcceptorI.cpp @@ -125,4 +125,4 @@ Ice::SSL::AcceptorI::AcceptorI( { } -Ice::SSL::AcceptorI::~AcceptorI() {} +Ice::SSL::AcceptorI::~AcceptorI() = default; diff --git a/cpp/src/Ice/SSL/SSLConnectorI.cpp b/cpp/src/Ice/SSL/SSLConnectorI.cpp index e468c00f9f9..2a50bc708fc 100644 --- a/cpp/src/Ice/SSL/SSLConnectorI.cpp +++ b/cpp/src/Ice/SSL/SSLConnectorI.cpp @@ -98,4 +98,4 @@ Ice::SSL::ConnectorI::ConnectorI(InstancePtr instance, IceInternal::ConnectorPtr { } -Ice::SSL::ConnectorI::~ConnectorI() {} +Ice::SSL::ConnectorI::~ConnectorI() = default; diff --git a/cpp/src/Ice/SSL/SSLEndpointI.cpp b/cpp/src/Ice/SSL/SSLEndpointI.cpp index ca55daada05..f4e593ffd76 100644 --- a/cpp/src/Ice/SSL/SSLEndpointI.cpp +++ b/cpp/src/Ice/SSL/SSLEndpointI.cpp @@ -76,10 +76,7 @@ Ice::SSL::OpenSSLConnectionInfo::~OpenSSLConnectionInfo() } #endif -Ice::SSL::EndpointInfo::~EndpointInfo() -{ - // out of line to avoid weak vtable -} +Ice::SSL::EndpointInfo::~EndpointInfo() = default; // Out of line to avoid weak vtable Ice::SSL::EndpointI::EndpointI(InstancePtr instance, IceInternal::EndpointIPtr del) : _instance(std::move(instance)), diff --git a/cpp/src/Ice/SSL/SSLEngine.cpp b/cpp/src/Ice/SSL/SSLEngine.cpp index 19f781417ef..ba0b7de432b 100644 --- a/cpp/src/Ice/SSL/SSLEngine.cpp +++ b/cpp/src/Ice/SSL/SSLEngine.cpp @@ -27,7 +27,7 @@ Ice::SSL::SSLEngine::SSLEngine(const IceInternal::InstancePtr& instance) { } -Ice::SSL::SSLEngine::~SSLEngine() {} +Ice::SSL::SSLEngine::~SSLEngine() = default; Ice::LoggerPtr Ice::SSL::SSLEngine::getLogger() const diff --git a/cpp/src/Ice/SSL/SchannelTransceiverI.cpp b/cpp/src/Ice/SSL/SchannelTransceiverI.cpp index b68ee60d306..33c4ce940d1 100644 --- a/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +++ b/cpp/src/Ice/SSL/SchannelTransceiverI.cpp @@ -1050,7 +1050,7 @@ Schannel::TransceiverI::TransceiverI( // trusted root certificates. } -Schannel::TransceiverI::~TransceiverI() {} +Schannel::TransceiverI::~TransceiverI() = default; bool Schannel::TransceiverI::writeRaw(IceInternal::Buffer& buf) diff --git a/cpp/src/Ice/Selector.cpp b/cpp/src/Ice/Selector.cpp index 16be1118577..b29faa172d5 100644 --- a/cpp/src/Ice/Selector.cpp +++ b/cpp/src/Ice/Selector.cpp @@ -960,7 +960,7 @@ EventHandlerWrapper::EventHandlerWrapper(EventHandler* handler, Selector& select } } -EventHandlerWrapper::~EventHandlerWrapper() {} +EventHandlerWrapper::~EventHandlerWrapper() = default; void EventHandlerWrapper::updateRunLoop() diff --git a/cpp/src/Ice/Selector.h b/cpp/src/Ice/Selector.h index c69afd182cc..04e147de461 100644 --- a/cpp/src/Ice/Selector.h +++ b/cpp/src/Ice/Selector.h @@ -134,7 +134,7 @@ namespace IceInternal class SelectorReadyCallback { public: - virtual ~SelectorReadyCallback() {} + virtual ~SelectorReadyCallback() = default; virtual void readyCallback(SocketOperation, int = 0) = 0; }; diff --git a/cpp/src/Ice/ServantManager.cpp b/cpp/src/Ice/ServantManager.cpp index ea15a1fc94e..f0855741e83 100644 --- a/cpp/src/Ice/ServantManager.cpp +++ b/cpp/src/Ice/ServantManager.cpp @@ -402,15 +402,7 @@ IceInternal::ServantManager::ServantManager(InstancePtr instance, string adapter { } -IceInternal::ServantManager::~ServantManager() -{ - // - // Don't check whether destroy() has been called. It might have - // not been called if the associated object adapter was not - // properly deactivated. - // - // assert(!_instance); -} +IceInternal::ServantManager::~ServantManager() = default; void IceInternal::ServantManager::destroy() diff --git a/cpp/src/Ice/SharedContext.h b/cpp/src/Ice/SharedContext.h index 3ebee210c81..933fc15af12 100644 --- a/cpp/src/Ice/SharedContext.h +++ b/cpp/src/Ice/SharedContext.h @@ -19,7 +19,7 @@ namespace IceInternal class SharedContext { public: - SharedContext() {} + SharedContext() = default; SharedContext(Ice::Context val) : _val(std::move(val)) {} diff --git a/cpp/src/Ice/StringConverter.cpp b/cpp/src/Ice/StringConverter.cpp index f4cceff0d7f..a14caa595da 100644 --- a/cpp/src/Ice/StringConverter.cpp +++ b/cpp/src/Ice/StringConverter.cpp @@ -213,10 +213,7 @@ namespace }; } -Ice::UTF8Buffer::~UTF8Buffer() -{ - // Out of line to avoid weak vtable -} +Ice::UTF8Buffer::~UTF8Buffer() = default; // Out of line to avoid weak vtable WstringConverterPtr Ice::createUnicodeWstringConverter() diff --git a/cpp/src/Ice/TcpConnector.cpp b/cpp/src/Ice/TcpConnector.cpp index 0f149787677..593cbea792c 100644 --- a/cpp/src/Ice/TcpConnector.cpp +++ b/cpp/src/Ice/TcpConnector.cpp @@ -126,5 +126,5 @@ IceInternal::TcpConnector::TcpConnector( { } -IceInternal::TcpConnector::~TcpConnector() {} +IceInternal::TcpConnector::~TcpConnector() = default; #endif diff --git a/cpp/src/Ice/TcpEndpointI.cpp b/cpp/src/Ice/TcpEndpointI.cpp index f0dcfe1c34c..5f02482fd97 100644 --- a/cpp/src/Ice/TcpEndpointI.cpp +++ b/cpp/src/Ice/TcpEndpointI.cpp @@ -357,7 +357,7 @@ IceInternal::TcpEndpointI::createEndpoint(const string& host, int port, const st IceInternal::TcpEndpointFactory::TcpEndpointFactory(ProtocolInstancePtr instance) : _instance(std::move(instance)) {} -IceInternal::TcpEndpointFactory::~TcpEndpointFactory() {} +IceInternal::TcpEndpointFactory::~TcpEndpointFactory() = default; int16_t IceInternal::TcpEndpointFactory::type() const diff --git a/cpp/src/Ice/TcpTransceiver.cpp b/cpp/src/Ice/TcpTransceiver.cpp index 5e337b385d5..0c1b7408425 100644 --- a/cpp/src/Ice/TcpTransceiver.cpp +++ b/cpp/src/Ice/TcpTransceiver.cpp @@ -145,5 +145,5 @@ IceInternal::TcpTransceiver::TcpTransceiver(ProtocolInstancePtr instance, Stream { } -IceInternal::TcpTransceiver::~TcpTransceiver() {} +IceInternal::TcpTransceiver::~TcpTransceiver() = default; #endif diff --git a/cpp/src/Ice/ThreadPool.h b/cpp/src/Ice/ThreadPool.h index 5d2030d2d1e..99b6c82d68c 100644 --- a/cpp/src/Ice/ThreadPool.h +++ b/cpp/src/Ice/ThreadPool.h @@ -208,15 +208,7 @@ namespace IceInternal class IOScope { public: - IOScope(ThreadPoolMessage& message) : _message(message) - { - // Nothing to do. - } - - ~IOScope() - { - // Nothing to do. - } + IOScope(ThreadPoolMessage& message) : _message(message) {} operator bool() { @@ -232,11 +224,6 @@ namespace IceInternal ThreadPoolMessage(ThreadPoolCurrent& current, const T&) : _current(current) {} - ~ThreadPoolMessage() - { - // Nothing to do. - } - private: ThreadPoolCurrent& _current; }; diff --git a/cpp/src/Ice/Timer.cpp b/cpp/src/Ice/Timer.cpp index 9aa69f5a2e6..a47cbfa811b 100644 --- a/cpp/src/Ice/Timer.cpp +++ b/cpp/src/Ice/Timer.cpp @@ -10,10 +10,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; -TimerTask::~TimerTask() -{ - // Out of line to avoid weak vtable -} +TimerTask::~TimerTask() = default; // Out of line to avoid weak vtable Timer::Timer() : _destroyed(false), _wakeUpTime(chrono::steady_clock::time_point()), _worker(&Timer::run, this) {} diff --git a/cpp/src/Ice/UdpConnector.cpp b/cpp/src/Ice/UdpConnector.cpp index 60d18b2b6e1..cf72a426399 100644 --- a/cpp/src/Ice/UdpConnector.cpp +++ b/cpp/src/Ice/UdpConnector.cpp @@ -130,4 +130,4 @@ IceInternal::UdpConnector::UdpConnector( { } -IceInternal::UdpConnector::~UdpConnector() {} +IceInternal::UdpConnector::~UdpConnector() = default; diff --git a/cpp/src/Ice/UdpEndpointI.cpp b/cpp/src/Ice/UdpEndpointI.cpp index e4893197fe3..3dcbfe0eba5 100644 --- a/cpp/src/Ice/UdpEndpointI.cpp +++ b/cpp/src/Ice/UdpEndpointI.cpp @@ -437,7 +437,7 @@ IceInternal::UdpEndpointI::createEndpoint(const string& host, int port, const st IceInternal::UdpEndpointFactory::UdpEndpointFactory(ProtocolInstancePtr instance) : _instance(std::move(instance)) {} -IceInternal::UdpEndpointFactory::~UdpEndpointFactory() {} +IceInternal::UdpEndpointFactory::~UdpEndpointFactory() = default; int16_t IceInternal::UdpEndpointFactory::type() const diff --git a/cpp/src/Ice/ValueFactory.cpp b/cpp/src/Ice/ValueFactory.cpp index e7e58cdd2f6..fffd36d4cb3 100644 --- a/cpp/src/Ice/ValueFactory.cpp +++ b/cpp/src/Ice/ValueFactory.cpp @@ -4,4 +4,4 @@ #include "Ice/ValueFactory.h" -Ice::ValueFactoryManager::~ValueFactoryManager() {} +Ice::ValueFactoryManager::~ValueFactoryManager() = default; diff --git a/cpp/src/Ice/WSAcceptor.cpp b/cpp/src/Ice/WSAcceptor.cpp index 0de67c153d6..3dcdcfd76dd 100644 --- a/cpp/src/Ice/WSAcceptor.cpp +++ b/cpp/src/Ice/WSAcceptor.cpp @@ -86,4 +86,4 @@ IceInternal::WSAcceptor::WSAcceptor(WSEndpointPtr endpoint, ProtocolInstancePtr { } -IceInternal::WSAcceptor::~WSAcceptor() {} +IceInternal::WSAcceptor::~WSAcceptor() = default; diff --git a/cpp/src/Ice/WSConnector.cpp b/cpp/src/Ice/WSConnector.cpp index 59d76f18ad8..16dbab11426 100644 --- a/cpp/src/Ice/WSConnector.cpp +++ b/cpp/src/Ice/WSConnector.cpp @@ -85,4 +85,4 @@ IceInternal::WSConnector::WSConnector(ProtocolInstancePtr instance, ConnectorPtr { } -IceInternal::WSConnector::~WSConnector() {} +IceInternal::WSConnector::~WSConnector() = default; diff --git a/cpp/src/Ice/WSTransceiver.cpp b/cpp/src/Ice/WSTransceiver.cpp index 4fefd20534a..bf3a258c54f 100644 --- a/cpp/src/Ice/WSTransceiver.cpp +++ b/cpp/src/Ice/WSTransceiver.cpp @@ -873,7 +873,7 @@ IceInternal::WSTransceiver::WSTransceiver(ProtocolInstancePtr instance, Transcei // } -IceInternal::WSTransceiver::~WSTransceiver() {} +IceInternal::WSTransceiver::~WSTransceiver() = default; void IceInternal::WSTransceiver::handleRequest(Buffer& responseBuffer) diff --git a/cpp/src/Ice/ios/StreamConnector.cpp b/cpp/src/Ice/ios/StreamConnector.cpp index d615534b275..e683ecd5539 100644 --- a/cpp/src/Ice/ios/StreamConnector.cpp +++ b/cpp/src/Ice/ios/StreamConnector.cpp @@ -139,5 +139,5 @@ IceObjC::StreamConnector::StreamConnector( { } -IceObjC::StreamConnector::~StreamConnector() {} +IceObjC::StreamConnector::~StreamConnector() = default; #endif diff --git a/cpp/src/IceBT/AcceptorI.cpp b/cpp/src/IceBT/AcceptorI.cpp index 62e43adff0e..7e156c33be6 100644 --- a/cpp/src/IceBT/AcceptorI.cpp +++ b/cpp/src/IceBT/AcceptorI.cpp @@ -212,4 +212,4 @@ IceBT::AcceptorI::AcceptorI( const_cast(_addr) = s; } -IceBT::AcceptorI::~AcceptorI() {} +IceBT::AcceptorI::~AcceptorI() = default; diff --git a/cpp/src/IceBT/DBus.h b/cpp/src/IceBT/DBus.h index fc586f69b49..e0a055eaef6 100644 --- a/cpp/src/IceBT/DBus.h +++ b/cpp/src/IceBT/DBus.h @@ -25,7 +25,7 @@ namespace IceBT std::string reason; protected: - Exception() {} + Exception() = default; Exception(const std::string& s) : reason(s) {} }; @@ -66,7 +66,7 @@ namespace IceBT virtual std::string getSignature() const = 0; protected: - Type() {} + Type() = default; }; class ArrayType : public Type @@ -85,7 +85,7 @@ namespace IceBT class VariantType : public Type { public: - VariantType() {} + VariantType() = default; virtual Kind getKind() const { return KindVariant; } diff --git a/cpp/src/IceBT/EndpointI.cpp b/cpp/src/IceBT/EndpointI.cpp index ee6103c455c..df1ebffed48 100644 --- a/cpp/src/IceBT/EndpointI.cpp +++ b/cpp/src/IceBT/EndpointI.cpp @@ -22,8 +22,8 @@ using namespace Ice; using namespace IceBT; // Implement virtual destructors out of line to avoid weak vtables. -IceBT::ConnectionInfo::~ConnectionInfo() {} -IceBT::EndpointInfo::~EndpointInfo() {} +IceBT::ConnectionInfo::~ConnectionInfo() = default; +IceBT::EndpointInfo::~EndpointInfo() = default; IceBT::EndpointI::EndpointI( const InstancePtr& instance, @@ -603,7 +603,7 @@ IceBT::EndpointI::checkOption(const string& option, const string& argument, cons IceBT::EndpointFactoryI::EndpointFactoryI(const InstancePtr& instance) : _instance(instance) {} -IceBT::EndpointFactoryI::~EndpointFactoryI() {} +IceBT::EndpointFactoryI::~EndpointFactoryI() = default; int16_t IceBT::EndpointFactoryI::type() const diff --git a/cpp/src/IceBT/Engine.cpp b/cpp/src/IceBT/Engine.cpp index 24277dc467f..d90c0285092 100644 --- a/cpp/src/IceBT/Engine.cpp +++ b/cpp/src/IceBT/Engine.cpp @@ -157,7 +157,7 @@ namespace IceBT public: ClientProfile(const ConnectionPtr& conn, const ConnectCallbackPtr& cb) : _connection(conn), _callback(cb) {} - ~ClientProfile() {} + ~ClientProfile() = default; protected: void newConnection(int fd) final diff --git a/cpp/src/IceBT/Instance.cpp b/cpp/src/IceBT/Instance.cpp index d14e16f0419..fe017bad5c4 100644 --- a/cpp/src/IceBT/Instance.cpp +++ b/cpp/src/IceBT/Instance.cpp @@ -15,7 +15,7 @@ IceBT::Instance::Instance(const EnginePtr& engine, int16_t type, const string& p { } -IceBT::Instance::~Instance() {} +IceBT::Instance::~Instance() = default; EnginePtr IceBT::Instance::engine() const diff --git a/cpp/src/IceBT/TransceiverI.cpp b/cpp/src/IceBT/TransceiverI.cpp index 75aca447a2a..7d1adf3cad0 100644 --- a/cpp/src/IceBT/TransceiverI.cpp +++ b/cpp/src/IceBT/TransceiverI.cpp @@ -175,7 +175,7 @@ IceBT::TransceiverI::TransceiverI(const InstancePtr& instance, const string& add { } -IceBT::TransceiverI::~TransceiverI() {} +IceBT::TransceiverI::~TransceiverI() = default; void IceBT::TransceiverI::connectCompleted(int fd, const ConnectionPtr& conn) diff --git a/cpp/src/IceDB/IceDB.cpp b/cpp/src/IceDB/IceDB.cpp index 3962f1bc13d..85f714ddfa1 100644 --- a/cpp/src/IceDB/IceDB.cpp +++ b/cpp/src/IceDB/IceDB.cpp @@ -187,11 +187,11 @@ Txn::mtxn() const return _mtxn; } -ReadOnlyTxn::~ReadOnlyTxn() {} +ReadOnlyTxn::~ReadOnlyTxn() = default; ReadOnlyTxn::ReadOnlyTxn(const Env& env) : Txn(env, MDB_RDONLY) {} -ReadWriteTxn::~ReadWriteTxn() {} +ReadWriteTxn::~ReadWriteTxn() = default; ReadWriteTxn::ReadWriteTxn(const Env& env) : Txn(env, 0) {} diff --git a/cpp/src/IceDB/IceDB.h b/cpp/src/IceDB/IceDB.h index ee0b29d5183..9139cb41d10 100644 --- a/cpp/src/IceDB/IceDB.h +++ b/cpp/src/IceDB/IceDB.h @@ -173,7 +173,7 @@ namespace IceDB { } - Dbi() {} + Dbi() = default; bool get(const Txn& txn, const K& key, D& data) const { @@ -291,8 +291,6 @@ namespace IceDB { } - ~Cursor() {} - bool get(K& key, D& data, MDB_cursor_op op) { MDB_val mkey, mdata; diff --git a/cpp/src/IceGrid/XMLParser.cpp b/cpp/src/IceGrid/XMLParser.cpp index 86ad0f2c9e9..da514addbdd 100644 --- a/cpp/src/IceGrid/XMLParser.cpp +++ b/cpp/src/IceGrid/XMLParser.cpp @@ -23,7 +23,7 @@ IceGrid::XMLParserException::ice_id() const noexcept // // XMLHandler // -IceGrid::XMLHandler::~XMLHandler() {} +IceGrid::XMLHandler::~XMLHandler() = default; // // expat callbacks diff --git a/cpp/src/IceStorm/Instance.cpp b/cpp/src/IceStorm/Instance.cpp index dc415c97170..f14438ab365 100644 --- a/cpp/src/IceStorm/Instance.cpp +++ b/cpp/src/IceStorm/Instance.cpp @@ -132,7 +132,7 @@ Instance::Instance( } } -Instance::~Instance() {} +Instance::~Instance() = default; void Instance::setNode(shared_ptr node) diff --git a/cpp/src/Slice/FileTracker.cpp b/cpp/src/Slice/FileTracker.cpp index b62538e4f7d..da03c03f9d6 100644 --- a/cpp/src/Slice/FileTracker.cpp +++ b/cpp/src/Slice/FileTracker.cpp @@ -19,7 +19,7 @@ static Slice::FileTrackerPtr Instance; Slice::FileTracker::FileTracker() : _curr(_generated.end()) {} -Slice::FileTracker::~FileTracker() {} +Slice::FileTracker::~FileTracker() = default; // The file tracker is not supposed to be thread safe. Slice::FileTrackerPtr diff --git a/cpp/src/Slice/GrammarUtil.h b/cpp/src/Slice/GrammarUtil.h index f6f87af16e3..349d1f24576 100644 --- a/cpp/src/Slice/GrammarUtil.h +++ b/cpp/src/Slice/GrammarUtil.h @@ -20,14 +20,14 @@ namespace Slice { struct StringTok final : public GrammarBase { - StringTok() {} + StringTok() = default; std::string v; std::string literal; }; struct MetadataListTok final : public GrammarBase { - MetadataListTok() {} + MetadataListTok() = default; MetadataList v; }; @@ -60,25 +60,25 @@ namespace Slice struct ExceptionListTok final : public GrammarBase { - ExceptionListTok() {} + ExceptionListTok() = default; ExceptionList v; }; struct InterfaceListTok final : public GrammarBase { - InterfaceListTok() {} + InterfaceListTok() = default; InterfaceList v; }; struct EnumeratorListTok final : public GrammarBase { - EnumeratorListTok() {} + EnumeratorListTok() = default; EnumeratorList v; }; struct ConstDefTok final : public GrammarBase { - ConstDefTok() {} + ConstDefTok() = default; ConstDefTok(SyntaxTreeBasePtr value, std::string stringValue) : v(std::move(value)), valueAsString(std::move(stringValue)) diff --git a/cpp/src/Slice/Parser.h b/cpp/src/Slice/Parser.h index 6fe2478eda7..94bb8dbcfb5 100644 --- a/cpp/src/Slice/Parser.h +++ b/cpp/src/Slice/Parser.h @@ -137,7 +137,7 @@ namespace Slice class ParserVisitor { public: - virtual ~ParserVisitor() {} + virtual ~ParserVisitor() = default; virtual bool visitUnitStart(const UnitPtr& /*unit*/) { return true; } virtual void visitUnitEnd(const UnitPtr& /*unit*/) {} virtual bool visitModuleStart(const ModulePtr& /*module*/) { return true; } diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 053fbca7b6d..201cfed091e 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -1358,18 +1358,15 @@ Slice::Gen::ProxyVisitor::visitInterfaceDefEnd(const InterfaceDefPtr& p) } // We can't use "= default" for the copy/move ctor/assignment operator as it's not correct with virtual inheritance. - + H << sp; H << nl << prx << "(const " << prx << "& other) noexcept : ::Ice::ObjectPrx(other)"; - H << sb << eb; + H << " {} // NOLINT:modernize-use-equals-default"; H << sp; - H << nl << prx << "(" << prx << "&& other) noexcept : ::Ice::ObjectPrx(::std::move(other))"; - H << sb << eb; + H << nl << prx << "(" << prx << "&& other) noexcept : ::Ice::ObjectPrx(std::move(other))"; + H << " {} // NOLINT:modernize-use-equals-default"; H << sp; - H << nl << prx << "(const ::Ice::CommunicatorPtr& communicator, std::string_view proxyString) :"; - H.inc(); - H << nl << "::Ice::ObjectPrx(communicator, proxyString)"; - H.dec(); - H << sb << eb; + H << nl << prx << "(const ::Ice::CommunicatorPtr& communicator, std::string_view proxyString)"; + H << " : ::Ice::ObjectPrx(communicator, proxyString) {} // NOLINT:modernize-use-equals-default"; H << sp; H << nl << prx << "& operator=(const " << prx << "& rhs) noexcept"; H << sb; @@ -1386,21 +1383,21 @@ Slice::Gen::ProxyVisitor::visitInterfaceDefEnd(const InterfaceDefPtr& p) // The self-assignment check is to make clang-tidy happy. H << nl << "if (this != &rhs)"; H << sb; - H << nl << "::Ice::ObjectPrx::operator=(::std::move(rhs));"; + H << nl << "::Ice::ObjectPrx::operator=(std::move(rhs));"; H << eb; H << nl << "return *this;"; H << eb; H << sp; H << nl << "/// \\cond INTERNAL"; H << nl << "static " << prx << " _fromReference(::IceInternal::ReferencePtr ref) { return " << prx - << "(::std::move(ref)); }"; + << "(std::move(ref)); }"; H.dec(); H << sp << nl << "protected:"; H.inc(); H << sp; H << nl << prx << "() = default;"; H << sp; - H << nl << "explicit " << prx << "(::IceInternal::ReferencePtr&& ref) : ::Ice::ObjectPrx(::std::move(ref))"; + H << nl << "explicit " << prx << "(::IceInternal::ReferencePtr&& ref) : ::Ice::ObjectPrx(std::move(ref))"; H << sb << eb; H << nl << "/// \\endcond"; diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index dc623b981fc..e66c85e80de 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -119,7 +119,7 @@ namespace Slice::CsVisitor::CsVisitor(Output& out) : _out(out) {} -Slice::CsVisitor::~CsVisitor() {} +Slice::CsVisitor::~CsVisitor() = default; void Slice::CsVisitor::writeMarshalUnmarshalParams( diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 123daba24f3..e6b72a5a1ca 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -117,7 +117,7 @@ namespace Slice::JavaVisitor::JavaVisitor(const string& dir) : JavaGenerator(dir) {} -Slice::JavaVisitor::~JavaVisitor() {} +Slice::JavaVisitor::~JavaVisitor() = default; string Slice::JavaVisitor::getResultType(const OperationPtr& op, const string& package, bool object, bool dispatch) @@ -2224,7 +2224,7 @@ Slice::Gen::Gen(const string& /*name*/, string base, const vector& inclu { } -Slice::Gen::~Gen() {} +Slice::Gen::~Gen() = default; void Slice::Gen::generate(const UnitPtr& p) diff --git a/cpp/src/slice2java/JavaUtil.cpp b/cpp/src/slice2java/JavaUtil.cpp index d24827f8f91..0eea4190d05 100644 --- a/cpp/src/slice2java/JavaUtil.cpp +++ b/cpp/src/slice2java/JavaUtil.cpp @@ -178,7 +178,7 @@ Slice::mapsToJavaBuiltinType(const TypePtr& p) return false; } -Slice::JavaOutput::JavaOutput() {} +Slice::JavaOutput::JavaOutput() = default; Slice::JavaOutput::JavaOutput(ostream& os) : Output(os) {} diff --git a/cpp/src/slice2js/Gen.cpp b/cpp/src/slice2js/Gen.cpp index 8c151e52490..4302c657847 100644 --- a/cpp/src/slice2js/Gen.cpp +++ b/cpp/src/slice2js/Gen.cpp @@ -271,7 +271,7 @@ namespace Slice::JsVisitor::JsVisitor(Output& out, const vector>& imports) : _out(out), _imports(imports) {} -Slice::JsVisitor::~JsVisitor() {} +Slice::JsVisitor::~JsVisitor() = default; vector> Slice::JsVisitor::imports() const diff --git a/cpp/src/slice2js/JsUtil.h b/cpp/src/slice2js/JsUtil.h index 670f0cfa1c0..52ff8b16b13 100644 --- a/cpp/src/slice2js/JsUtil.h +++ b/cpp/src/slice2js/JsUtil.h @@ -19,7 +19,7 @@ namespace Slice public: JsGenerator() = default; JsGenerator(const JsGenerator&) = delete; - virtual ~JsGenerator() {}; + virtual ~JsGenerator() = default; JsGenerator& operator=(const JsGenerator&) = delete; static std::string fixDataMemberName(const std::string&, bool, bool); diff --git a/cpp/test/Ice/exceptions/TestAMDI.cpp b/cpp/test/Ice/exceptions/TestAMDI.cpp index 8b47765c8e4..61d6f734822 100644 --- a/cpp/test/Ice/exceptions/TestAMDI.cpp +++ b/cpp/test/Ice/exceptions/TestAMDI.cpp @@ -19,7 +19,7 @@ endsWith(const string& s, const string& findme) return false; } -ThrowerI::ThrowerI() {} +ThrowerI::ThrowerI() = default; void ThrowerI::shutdownAsync(function response, function, const Ice::Current& current) diff --git a/cpp/test/Ice/exceptions/TestI.cpp b/cpp/test/Ice/exceptions/TestI.cpp index fb037feb133..28c41b6917a 100644 --- a/cpp/test/Ice/exceptions/TestI.cpp +++ b/cpp/test/Ice/exceptions/TestI.cpp @@ -9,7 +9,7 @@ using namespace Test; using namespace std; -ThrowerI::ThrowerI() {} +ThrowerI::ThrowerI() = default; void ThrowerI::shutdown(const Ice::Current& current) diff --git a/cpp/test/Ice/faultTolerance/TestI.cpp b/cpp/test/Ice/faultTolerance/TestI.cpp index 6a9e300660d..f4c86899c22 100644 --- a/cpp/test/Ice/faultTolerance/TestI.cpp +++ b/cpp/test/Ice/faultTolerance/TestI.cpp @@ -9,7 +9,7 @@ # include #endif -TestI::TestI() {} +TestI::TestI() = default; void TestI::shutdown(const Ice::Current& current) diff --git a/cpp/test/Ice/location/ServerLocator.cpp b/cpp/test/Ice/location/ServerLocator.cpp index a7f0ef2dfde..5b3c2848991 100644 --- a/cpp/test/Ice/location/ServerLocator.cpp +++ b/cpp/test/Ice/location/ServerLocator.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace Ice; -ServerLocatorRegistry::ServerLocatorRegistry() {} +ServerLocatorRegistry::ServerLocatorRegistry() = default; void ServerLocatorRegistry::setAdapterDirectProxyAsync( diff --git a/cpp/test/Ice/objects/TestI.cpp b/cpp/test/Ice/objects/TestI.cpp index d0d9d1511a3..6d4d4553084 100644 --- a/cpp/test/Ice/objects/TestI.cpp +++ b/cpp/test/Ice/objects/TestI.cpp @@ -52,7 +52,7 @@ EI::checkValues() return i == 1 && s == "hello"; } -FI::FI() {} +FI::FI() = default; FI::FI(const EPtr& e) : F(e, e) {} diff --git a/cpp/test/Ice/operations/OnewaysAMI.cpp b/cpp/test/Ice/operations/OnewaysAMI.cpp index 69944abb5a5..b165c00ae53 100644 --- a/cpp/test/Ice/operations/OnewaysAMI.cpp +++ b/cpp/test/Ice/operations/OnewaysAMI.cpp @@ -15,7 +15,7 @@ namespace public: CallbackBase() : _called(false) {} - virtual ~CallbackBase() {} + virtual ~CallbackBase() = default; void check() { @@ -42,7 +42,7 @@ namespace class Callback : public CallbackBase { public: - Callback() {} + Callback() = default; void sent(bool) { called(); } diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index 0f8b7d850b0..3f9e2999b53 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -32,7 +32,7 @@ namespace public: CallbackBase() : _called(false) {} - virtual ~CallbackBase() {} + virtual ~CallbackBase() = default; void check() { @@ -59,7 +59,7 @@ namespace class Callback : public CallbackBase { public: - Callback() {} + Callback() = default; Callback(CommunicatorPtr communicator) : _communicator(std::move(communicator)) {} diff --git a/cpp/test/Ice/optional/TestAMDI.cpp b/cpp/test/Ice/optional/TestAMDI.cpp index 83dc8d5ee31..e5ccedcf0d8 100644 --- a/cpp/test/Ice/optional/TestAMDI.cpp +++ b/cpp/test/Ice/optional/TestAMDI.cpp @@ -9,7 +9,7 @@ using namespace Test; using namespace Ice; using namespace std; -InitialI::InitialI() {} +InitialI::InitialI() = default; void InitialI::shutdownAsync(function response, function, const Ice::Current& current) diff --git a/cpp/test/Ice/optional/TestI.cpp b/cpp/test/Ice/optional/TestI.cpp index fc503a8921a..275bc68f00b 100644 --- a/cpp/test/Ice/optional/TestI.cpp +++ b/cpp/test/Ice/optional/TestI.cpp @@ -9,7 +9,7 @@ using namespace Test; using namespace Ice; using namespace std; -InitialI::InitialI() {} +InitialI::InitialI() = default; void InitialI::shutdown(const Current& current) diff --git a/cpp/test/Ice/plugin/Plugin.cpp b/cpp/test/Ice/plugin/Plugin.cpp index 2850dbb2873..aa8be3730bd 100644 --- a/cpp/test/Ice/plugin/Plugin.cpp +++ b/cpp/test/Ice/plugin/Plugin.cpp @@ -39,7 +39,7 @@ namespace class CustomPluginException : public std::exception { public: - CustomPluginException() noexcept {} + CustomPluginException() noexcept = default; [[nodiscard]] const char* what() const noexcept override { return "CustomPluginException"; } }; diff --git a/cpp/test/Ice/proxy/TestAMDI.cpp b/cpp/test/Ice/proxy/TestAMDI.cpp index da318bf8e41..84646fd6523 100644 --- a/cpp/test/Ice/proxy/TestAMDI.cpp +++ b/cpp/test/Ice/proxy/TestAMDI.cpp @@ -8,7 +8,7 @@ using namespace std; -MyDerivedClassI::MyDerivedClassI() {} +MyDerivedClassI::MyDerivedClassI() = default; void MyDerivedClassI::echoAsync( diff --git a/cpp/test/Ice/proxy/TestI.cpp b/cpp/test/Ice/proxy/TestI.cpp index 023e2f620b1..afe012e1de4 100644 --- a/cpp/test/Ice/proxy/TestI.cpp +++ b/cpp/test/Ice/proxy/TestI.cpp @@ -8,7 +8,7 @@ using namespace std; using namespace Ice; -MyDerivedClassI::MyDerivedClassI() {} +MyDerivedClassI::MyDerivedClassI() = default; optional MyDerivedClassI::echo(optional obj, const Current&) diff --git a/cpp/test/Ice/retry/AllTests.cpp b/cpp/test/Ice/retry/AllTests.cpp index 337530d9d06..f8eaebb82b5 100644 --- a/cpp/test/Ice/retry/AllTests.cpp +++ b/cpp/test/Ice/retry/AllTests.cpp @@ -15,7 +15,7 @@ class CallbackBase public: CallbackBase() : _called(false) {} - virtual ~CallbackBase() {} + virtual ~CallbackBase() = default; void check() { diff --git a/cpp/test/Ice/slicing/exceptions/TestAMDI.cpp b/cpp/test/Ice/slicing/exceptions/TestAMDI.cpp index a1003fa12df..1c6aea5e0e1 100644 --- a/cpp/test/Ice/slicing/exceptions/TestAMDI.cpp +++ b/cpp/test/Ice/slicing/exceptions/TestAMDI.cpp @@ -10,7 +10,7 @@ using namespace Test; using namespace std; using namespace Ice; -TestI::TestI() {} +TestI::TestI() = default; void TestI::baseAsBaseAsync(function, function error, const Current&) diff --git a/cpp/test/Ice/slicing/exceptions/TestI.cpp b/cpp/test/Ice/slicing/exceptions/TestI.cpp index b554559e3d5..6ce7be0377c 100644 --- a/cpp/test/Ice/slicing/exceptions/TestI.cpp +++ b/cpp/test/Ice/slicing/exceptions/TestI.cpp @@ -10,7 +10,7 @@ using namespace std; using namespace Test; using namespace Ice; -TestI::TestI() {} +TestI::TestI() = default; void TestI::baseAsBase(const Current&) diff --git a/cpp/test/Ice/slicing/objects/AllTests.cpp b/cpp/test/Ice/slicing/objects/AllTests.cpp index 56444713cae..84dc10d40a7 100644 --- a/cpp/test/Ice/slicing/objects/AllTests.cpp +++ b/cpp/test/Ice/slicing/objects/AllTests.cpp @@ -126,7 +126,7 @@ namespace public: CallbackBase() : _called(false) {} - virtual ~CallbackBase() {} + virtual ~CallbackBase() = default; void check() { diff --git a/cpp/test/Ice/slicing/objects/TestAMDI.cpp b/cpp/test/Ice/slicing/objects/TestAMDI.cpp index b512654f9ef..0bcb04bcfc2 100644 --- a/cpp/test/Ice/slicing/objects/TestAMDI.cpp +++ b/cpp/test/Ice/slicing/objects/TestAMDI.cpp @@ -9,7 +9,7 @@ using namespace Test; using namespace std; -TestI::TestI() {} +TestI::TestI() = default; void TestI::SBaseAsObjectAsync( diff --git a/cpp/test/Ice/slicing/objects/TestI.cpp b/cpp/test/Ice/slicing/objects/TestI.cpp index 6f41d9e5273..95d2f4d21ca 100644 --- a/cpp/test/Ice/slicing/objects/TestI.cpp +++ b/cpp/test/Ice/slicing/objects/TestI.cpp @@ -134,7 +134,7 @@ namespace } } -TestI::TestI() {} +TestI::TestI() = default; TestI::~TestI() { diff --git a/cpp/test/IceBox/admin/Service.cpp b/cpp/test/IceBox/admin/Service.cpp index 123980a00bf..8904c7e1ccc 100644 --- a/cpp/test/IceBox/admin/Service.cpp +++ b/cpp/test/IceBox/admin/Service.cpp @@ -50,7 +50,7 @@ ServiceI::ServiceI(const CommunicatorPtr& serviceManagerCommunicator) admin->addUpdateCallback([facet](const Ice::PropertyDict& changes) { facet->updated(changes); }); } -ServiceI::~ServiceI() {} +ServiceI::~ServiceI() = default; void ServiceI::start(const string&, const CommunicatorPtr&, const StringSeq&) diff --git a/cpp/test/IceBox/admin/TestI.cpp b/cpp/test/IceBox/admin/TestI.cpp index 97170bb5198..a9411b5c219 100644 --- a/cpp/test/IceBox/admin/TestI.cpp +++ b/cpp/test/IceBox/admin/TestI.cpp @@ -8,7 +8,7 @@ using namespace Test; using namespace std; -TestFacetI::TestFacetI() {} +TestFacetI::TestFacetI() = default; Ice::PropertyDict TestFacetI::getChanges(const Ice::Current&) diff --git a/cpp/test/IceBox/configuration/Service.cpp b/cpp/test/IceBox/configuration/Service.cpp index 271bf5f9ca8..f7803cdfbde 100644 --- a/cpp/test/IceBox/configuration/Service.cpp +++ b/cpp/test/IceBox/configuration/Service.cpp @@ -28,9 +28,9 @@ extern "C" ICE_DECLSPEC_EXPORT ::IceBox::Service* create(const CommunicatorPtr&) { return new ServiceI; } } -ServiceI::ServiceI() {} +ServiceI::ServiceI() = default; -ServiceI::~ServiceI() {} +ServiceI::~ServiceI() = default; void ServiceI::start(const string& name, const CommunicatorPtr& communicator, const StringSeq& args) diff --git a/cpp/test/IceGrid/activation/AllTests.cpp b/cpp/test/IceGrid/activation/AllTests.cpp index 5fde1dc5cba..0b0f9eaf312 100644 --- a/cpp/test/IceGrid/activation/AllTests.cpp +++ b/cpp/test/IceGrid/activation/AllTests.cpp @@ -40,7 +40,7 @@ class Pinger { } - virtual ~Pinger() {} + virtual ~Pinger() = default; virtual void run() { diff --git a/cpp/test/IceGrid/deployer/Service.cpp b/cpp/test/IceGrid/deployer/Service.cpp index ecf77a721e2..5de14dcaecb 100644 --- a/cpp/test/IceGrid/deployer/Service.cpp +++ b/cpp/test/IceGrid/deployer/Service.cpp @@ -28,9 +28,9 @@ extern "C" ICE_DECLSPEC_EXPORT ::IceBox::Service* create(const CommunicatorPtr&) { return new ServiceI; } } -ServiceI::ServiceI() {} +ServiceI::ServiceI() = default; -ServiceI::~ServiceI() {} +ServiceI::~ServiceI() = default; void ServiceI::start(const string& name, const CommunicatorPtr& communicator, const StringSeq&) diff --git a/cpp/test/IceGrid/replication/TestI.cpp b/cpp/test/IceGrid/replication/TestI.cpp index 24ea202c8b5..9e6769448c4 100644 --- a/cpp/test/IceGrid/replication/TestI.cpp +++ b/cpp/test/IceGrid/replication/TestI.cpp @@ -5,4 +5,4 @@ #include "TestI.h" #include "Ice/Ice.h" -TestI::TestI() {} +TestI::TestI() = default; diff --git a/cpp/test/IceGrid/simple/TestI.cpp b/cpp/test/IceGrid/simple/TestI.cpp index 0eb8a5bc9ff..a4ba2924364 100644 --- a/cpp/test/IceGrid/simple/TestI.cpp +++ b/cpp/test/IceGrid/simple/TestI.cpp @@ -7,7 +7,7 @@ using namespace Test; -TestI::TestI() {} +TestI::TestI() = default; void TestI::shutdown(const Ice::Current& current) diff --git a/php/src/Types.cpp b/php/src/Types.cpp index 50431288b9e..ea53afb11a9 100644 --- a/php/src/Types.cpp +++ b/php/src/Types.cpp @@ -468,10 +468,10 @@ IcePHP::StreamUtil::getSlicedDataMember(zval* obj, ObjectMap* objectMap) } // UnmarshalCallback implementation. -IcePHP::UnmarshalCallback::~UnmarshalCallback() {} +IcePHP::UnmarshalCallback::~UnmarshalCallback() = default; // TypeInfo implementation. -IcePHP::TypeInfo::TypeInfo() {} +IcePHP::TypeInfo::TypeInfo() = default; bool IcePHP::TypeInfo::usesClasses() const @@ -2261,7 +2261,7 @@ IcePHP::DictionaryInfo::KeyCallback::unmarshaled(zval* zv, zval*, void*) IcePHP::DictionaryInfo::ValueCallback::ValueCallback(zval* k) { ZVAL_COPY_VALUE(&key, k); } -IcePHP::DictionaryInfo::ValueCallback::~ValueCallback() {} +IcePHP::DictionaryInfo::ValueCallback::~ValueCallback() = default; void IcePHP::DictionaryInfo::ValueCallback::unmarshaled(zval* zv, zval* target, void*) diff --git a/ruby/src/IceRuby/Operation.cpp b/ruby/src/IceRuby/Operation.cpp index 63e8d91a5c3..fd7def0bda4 100644 --- a/ruby/src/IceRuby/Operation.cpp +++ b/ruby/src/IceRuby/Operation.cpp @@ -136,7 +136,7 @@ IceRuby_Operation_deprecate(VALUE self, VALUE msg) // // Operation implementation. // -IceRuby::Operation::~Operation() {} +IceRuby::Operation::~Operation() = default; // // ParamInfo implementation. diff --git a/ruby/src/IceRuby/Types.cpp b/ruby/src/IceRuby/Types.cpp index 368e6eb2b1a..40bf78b92c1 100644 --- a/ruby/src/IceRuby/Types.cpp +++ b/ruby/src/IceRuby/Types.cpp @@ -169,7 +169,7 @@ addExceptionInfo(const string& id, const ExceptionInfoPtr& info) VALUE IceRuby::StreamUtil::_slicedDataType = Qnil; VALUE IceRuby::StreamUtil::_sliceInfoType = Qnil; -IceRuby::StreamUtil::StreamUtil() {} +IceRuby::StreamUtil::StreamUtil() = default; IceRuby::StreamUtil::~StreamUtil() { @@ -390,12 +390,12 @@ IceRuby::StreamUtil::getSlicedDataMember(VALUE obj, ValueMap* valueMap) // // UnmarshalCallback implementation. // -IceRuby::UnmarshalCallback::~UnmarshalCallback() {} +IceRuby::UnmarshalCallback::~UnmarshalCallback() = default; // // TypeInfo implementation. // -IceRuby::TypeInfo::TypeInfo() {} +IceRuby::TypeInfo::TypeInfo() = default; bool IceRuby::TypeInfo::usesClasses() const @@ -417,7 +417,7 @@ IceRuby::TypeInfo::destroy() // // PrimitiveInfo implementation. // -IceRuby::PrimitiveInfo::PrimitiveInfo() {} +IceRuby::PrimitiveInfo::PrimitiveInfo() = default; IceRuby::PrimitiveInfo::PrimitiveInfo(Kind k) : kind(k) {} diff --git a/ruby/src/IceRuby/Util.h b/ruby/src/IceRuby/Util.h index f08d72ce648..329fe3492c1 100644 --- a/ruby/src/IceRuby/Util.h +++ b/ruby/src/IceRuby/Util.h @@ -114,7 +114,7 @@ namespace IceRuby class HashIterator { public: - virtual ~HashIterator() {} + virtual ~HashIterator() = default; virtual void element(VALUE, VALUE) = 0; };