From 0c03e8e3676463cc5577fa456bb13c5cf5241e66 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Wed, 13 Mar 2024 14:54:45 -0400 Subject: [PATCH] C++ cleanup (#1927) --- cpp/include/Ice/Exception.h | 4 +- cpp/include/Ice/LocalException.h | 130 +++++++++---------- cpp/include/Ice/Object.h | 2 +- cpp/include/Ice/Proxy.h | 52 ++++---- cpp/include/Ice/Value.h | 2 +- cpp/include/IceBT/Types.h | 2 +- cpp/include/IceBox/Service.h | 2 +- cpp/src/Ice/Exception.cpp | 4 +- cpp/src/Ice/LocalException.cpp | 130 +++++++++---------- cpp/src/Ice/Object.cpp | 2 +- cpp/src/Ice/Proxy.cpp | 38 +++--- cpp/src/Ice/ProxyAsync.cpp | 4 +- cpp/src/Ice/Reference.cpp | 58 ++++----- cpp/src/Ice/Reference.h | 48 +++---- cpp/src/Ice/ReferenceFactory.cpp | 2 +- cpp/src/Ice/ReferenceFactory.h | 2 +- cpp/src/Ice/Value.cpp | 2 +- cpp/src/IceBT/Types.cpp | 2 +- cpp/src/IceBox/Service.cpp | 2 +- cpp/src/IceGrid/SynchronizationException.cpp | 2 +- cpp/src/IceGrid/SynchronizationException.h | 2 +- cpp/src/IceStorm/SendQueueSizeMaxReached.cpp | 2 +- cpp/src/IceStorm/SendQueueSizeMaxReached.h | 2 +- cpp/src/slice2cpp/Gen.cpp | 73 ++++------- 24 files changed, 277 insertions(+), 292 deletions(-) diff --git a/cpp/include/Ice/Exception.h b/cpp/include/Ice/Exception.h index acf93667cef..b48dd2add73 100644 --- a/cpp/include/Ice/Exception.h +++ b/cpp/include/Ice/Exception.h @@ -44,7 +44,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - static std::string_view ice_staticId(); + static std::string_view ice_staticId() noexcept; }; /** @@ -64,7 +64,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - static std::string_view ice_staticId(); + static std::string_view ice_staticId() noexcept; /// \cond STREAM virtual void _write(::Ice::OutputStream*) const; diff --git a/cpp/include/Ice/LocalException.h b/cpp/include/Ice/LocalException.h index f4740c82aa5..d4b0374c5c0 100644 --- a/cpp/include/Ice/LocalException.h +++ b/cpp/include/Ice/LocalException.h @@ -76,7 +76,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -134,7 +134,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -181,7 +181,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -244,7 +244,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -315,7 +315,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -380,7 +380,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -428,7 +428,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -482,7 +482,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -543,7 +543,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -598,7 +598,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -638,7 +638,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -679,7 +679,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -734,7 +734,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -793,7 +793,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -850,7 +850,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -908,7 +908,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -966,7 +966,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1023,7 +1023,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1081,7 +1081,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1138,7 +1138,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1183,7 +1183,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1236,7 +1236,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1308,7 +1308,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1384,7 +1384,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1447,7 +1447,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1509,7 +1509,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1560,7 +1560,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1618,7 +1618,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1671,7 +1671,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1718,7 +1718,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1775,7 +1775,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1827,7 +1827,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1879,7 +1879,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1930,7 +1930,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -1980,7 +1980,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2019,7 +2019,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2059,7 +2059,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2099,7 +2099,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2139,7 +2139,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2179,7 +2179,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2219,7 +2219,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2271,7 +2271,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2329,7 +2329,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2398,7 +2398,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2471,7 +2471,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2532,7 +2532,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2584,7 +2584,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2636,7 +2636,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2688,7 +2688,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2743,7 +2743,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2798,7 +2798,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2855,7 +2855,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2906,7 +2906,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -2959,7 +2959,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -3010,7 +3010,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -3062,7 +3062,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -3114,7 +3114,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -3172,7 +3172,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -3244,7 +3244,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -3304,7 +3304,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -3356,7 +3356,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -3408,7 +3408,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -3461,7 +3461,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -3518,7 +3518,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. @@ -3562,7 +3562,7 @@ namespace Ice * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICE_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. diff --git a/cpp/include/Ice/Object.h b/cpp/include/Ice/Object.h index 19082e0b585..ee39722234d 100644 --- a/cpp/include/Ice/Object.h +++ b/cpp/include/Ice/Object.h @@ -97,7 +97,7 @@ namespace Ice * Obtains the Slice type ID of this type. * @return The return value is always "::Ice::Object". */ - static std::string_view ice_staticId(); + static std::string_view ice_staticId() noexcept; protected: /// \cond INTERNAL diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h index 60cc2fbad88..3db65889606 100644 --- a/cpp/include/Ice/Proxy.h +++ b/cpp/include/Ice/Proxy.h @@ -59,15 +59,14 @@ namespace Ice */ const Prx* operator->() const { return &asPrx(); } - // We don't provide the non-const operator-> because only the assignment operators can modify the proxy - and - // you shouldn't call operator-> before calling operator=. + // We don't provide the non-const operator-> because only the assignment operators can modify the proxy. /** * Obtains a proxy that is identical to this proxy, except for the adapter ID. * @param id The adapter ID for the new proxy. * @return A proxy with the new adapter ID. */ - Prx ice_adapterId(const std::string& id) const { return fromReference(asPrx()._adapterId(id)); } + Prx ice_adapterId(std::string id) const { return fromReference(asPrx()._adapterId(std::move(id))); } /** * Obtains a proxy that is identical to this proxy, but uses batch datagram invocations. @@ -109,14 +108,14 @@ namespace Ice * connection ID. * @return A proxy with the specified connection ID. */ - Prx ice_connectionId(const ::std::string& id) const { return fromReference(asPrx()._connectionId(id)); } + Prx ice_connectionId(std::string id) const { return fromReference(asPrx()._connectionId(std::move(id))); } /** * Obtains a proxy that is identical to this proxy, except for the per-proxy context. * @param context The context for the new proxy. * @return A proxy with the new per-proxy context. */ - Prx ice_context(const ::Ice::Context& context) const { return fromReference(asPrx()._context(context)); } + Prx ice_context(Context context) const { return fromReference(asPrx()._context(std::move(context))); } /** * Obtains a proxy that is identical to this proxy, but uses datagram invocations. @@ -130,9 +129,9 @@ namespace Ice * @param version The encoding version to use to marshal request parameters. * @return A proxy with the specified encoding version. */ - Prx ice_encodingVersion(const ::Ice::EncodingVersion& version) const + Prx ice_encodingVersion(EncodingVersion version) const { - return fromReference(asPrx()._encodingVersion(version)); + return fromReference(asPrx()._encodingVersion(std::move(version))); } /** @@ -140,7 +139,7 @@ namespace Ice * @param type The new endpoint selection policy. * @return A proxy with the specified endpoint selection policy. */ - Prx ice_endpointSelection(::Ice::EndpointSelectionType type) const + Prx ice_endpointSelection(EndpointSelectionType type) const { return fromReference(asPrx()._endpointSelection(type)); } @@ -150,9 +149,9 @@ namespace Ice * @param endpoints The endpoints for the new proxy. * @return A proxy with the new endpoints. */ - Prx ice_endpoints(const ::Ice::EndpointSeq& endpoints) const + Prx ice_endpoints(EndpointSeq endpoints) const { - return fromReference(asPrx()._endpoints(endpoints)); + return fromReference(asPrx()._endpoints(std::move(endpoints))); } /** @@ -161,9 +160,9 @@ namespace Ice * @param connection The fixed proxy connection. * @return A fixed proxy bound to the given connection. */ - Prx ice_fixed(const std::shared_ptr<::Ice::Connection>& connection) const + Prx ice_fixed(std::shared_ptr connection) const { - return fromReference(asPrx()._fixed(connection)); + return fromReference(asPrx()._fixed(std::move(connection))); } /** @@ -210,7 +209,10 @@ namespace Ice * @param router The router for the new proxy. * @return A proxy with the specified router. */ - Prx ice_router(const std::optional& router) const { return fromReference(asPrx()._router(router)); } + Prx ice_router(const std::optional& router) const + { + return fromReference(asPrx()._router(std::move(router))); + } /** * Obtains a proxy that is identical to this proxy, except for how it selects endpoints. @@ -264,7 +266,7 @@ namespace Ice ObjectPrx(const ObjectPrx& other) noexcept = default; ObjectPrx(ObjectPrx&&) noexcept = default; - ObjectPrx(const std::shared_ptr& communicator, const std::string& proxyString); + ObjectPrx(const std::shared_ptr& communicator, std::string_view proxyString); virtual ~ObjectPrx() = default; @@ -435,7 +437,7 @@ namespace Ice * @return The future object for the invocation. */ std::future>> ice_invokeAsync( - const std::string& operation, + std::string_view operation, Ice::OperationMode mode, const std::vector& inParams, const Ice::Context& context = Ice::noExplicitContext) const; @@ -488,7 +490,7 @@ namespace Ice * @return The future object for the invocation. */ std::future>> ice_invokeAsync( - const std::string& operation, + std::string_view operation, Ice::OperationMode mode, const std::pair& inParams, const Ice::Context& context = Ice::noExplicitContext) const; @@ -584,7 +586,7 @@ namespace Ice * @param id The identity for the new proxy. * @return A proxy with the new identity. */ - ObjectPrx ice_identity(const Ice::Identity& id) const; + ObjectPrx ice_identity(Ice::Identity id) const; /** * Obtains the per-proxy context for this proxy. @@ -603,7 +605,7 @@ namespace Ice * @param facet The facet for the new proxy. * @return A proxy with the new facet. */ - Ice::ObjectPrx ice_facet(const ::std::string& facet) const; + Ice::ObjectPrx ice_facet(std::string facet) const; /** * Obtains the adapter ID for this proxy. @@ -739,7 +741,7 @@ namespace Ice * Returns the Slice type ID associated with this type. * @return The Slice type ID. */ - static std::string_view ice_staticId(); + static std::string_view ice_staticId() noexcept; /** * Obtains the communicator that created this proxy. @@ -781,19 +783,19 @@ namespace Ice template friend class Proxy; // Gets a reference with the specified setting; returns _reference if the setting is already set. - IceInternal::ReferencePtr _adapterId(const std::string&) const; + IceInternal::ReferencePtr _adapterId(std::string) const; IceInternal::ReferencePtr _batchDatagram() const; IceInternal::ReferencePtr _batchOneway() const; IceInternal::ReferencePtr _collocationOptimized(bool) const; IceInternal::ReferencePtr _compress(bool) const; IceInternal::ReferencePtr _connectionCached(bool) const; - IceInternal::ReferencePtr _connectionId(const std::string&) const; - IceInternal::ReferencePtr _context(const Context&) const; + IceInternal::ReferencePtr _connectionId(std::string) const; + IceInternal::ReferencePtr _context(Context) const; IceInternal::ReferencePtr _datagram() const; - IceInternal::ReferencePtr _encodingVersion(const EncodingVersion&) const; + IceInternal::ReferencePtr _encodingVersion(EncodingVersion) const; IceInternal::ReferencePtr _endpointSelection(EndpointSelectionType) const; - IceInternal::ReferencePtr _endpoints(const EndpointSeq&) const; - IceInternal::ReferencePtr _fixed(const ConnectionPtr&) const; + IceInternal::ReferencePtr _endpoints(EndpointSeq) const; + IceInternal::ReferencePtr _fixed(ConnectionPtr) const; IceInternal::ReferencePtr _invocationTimeout(int) const; IceInternal::ReferencePtr _locator(const std::optional&) const; IceInternal::ReferencePtr _locatorCacheTimeout(int) const; diff --git a/cpp/include/Ice/Value.h b/cpp/include/Ice/Value.h index 63e979ae9cb..657015a3601 100644 --- a/cpp/include/Ice/Value.h +++ b/cpp/include/Ice/Value.h @@ -58,7 +58,7 @@ namespace Ice * Obtains the Slice type ID of this type. * @return The return value is always "::Ice::Object". */ - static std::string_view ice_staticId(); + static std::string_view ice_staticId() noexcept; /** * Returns a shallow copy of the object. diff --git a/cpp/include/IceBT/Types.h b/cpp/include/IceBT/Types.h index 0fd64b6b378..e6ad3d886cd 100644 --- a/cpp/include/IceBT/Types.h +++ b/cpp/include/IceBT/Types.h @@ -73,7 +73,7 @@ namespace IceBT * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICEBT_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICEBT_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. diff --git a/cpp/include/IceBox/Service.h b/cpp/include/IceBox/Service.h index 7af3e3c71c5..cfc9c7e6c4c 100644 --- a/cpp/include/IceBox/Service.h +++ b/cpp/include/IceBox/Service.h @@ -86,7 +86,7 @@ namespace IceBox * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - ICE_MEMBER(ICEBOX_API) static ::std::string_view ice_staticId(); + ICE_MEMBER(ICEBOX_API) static ::std::string_view ice_staticId() noexcept; /** * Prints this exception to the given stream. * @param stream The target stream. diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp index b7ea59725ca..dcd38f3cd03 100644 --- a/cpp/src/Ice/Exception.cpp +++ b/cpp/src/Ice/Exception.cpp @@ -78,7 +78,7 @@ namespace } std::string_view -Ice::UserException::ice_staticId() +Ice::UserException::ice_staticId() noexcept { return userException_ids[0]; } @@ -130,7 +130,7 @@ namespace } std::string_view -Ice::LocalException::ice_staticId() +Ice::LocalException::ice_staticId() noexcept { return localException_ids[0]; } diff --git a/cpp/src/Ice/LocalException.cpp b/cpp/src/Ice/LocalException.cpp index c9c1fe630c0..38e8c1678dc 100644 --- a/cpp/src/Ice/LocalException.cpp +++ b/cpp/src/Ice/LocalException.cpp @@ -22,7 +22,7 @@ Ice::InitializationException::~InitializationException() {} std::string_view -Ice::InitializationException::ice_staticId() +Ice::InitializationException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::InitializationException"; return typeId; @@ -31,7 +31,7 @@ Ice::InitializationException::ice_staticId() Ice::PluginInitializationException::~PluginInitializationException() {} std::string_view -Ice::PluginInitializationException::ice_staticId() +Ice::PluginInitializationException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::PluginInitializationException"; return typeId; @@ -40,7 +40,7 @@ Ice::PluginInitializationException::ice_staticId() Ice::CollocationOptimizationException::~CollocationOptimizationException() {} std::string_view -Ice::CollocationOptimizationException::ice_staticId() +Ice::CollocationOptimizationException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::CollocationOptimizationException"; return typeId; @@ -49,7 +49,7 @@ Ice::CollocationOptimizationException::ice_staticId() Ice::AlreadyRegisteredException::~AlreadyRegisteredException() {} std::string_view -Ice::AlreadyRegisteredException::ice_staticId() +Ice::AlreadyRegisteredException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::AlreadyRegisteredException"; return typeId; @@ -58,7 +58,7 @@ Ice::AlreadyRegisteredException::ice_staticId() Ice::NotRegisteredException::~NotRegisteredException() {} std::string_view -Ice::NotRegisteredException::ice_staticId() +Ice::NotRegisteredException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::NotRegisteredException"; return typeId; @@ -67,7 +67,7 @@ Ice::NotRegisteredException::ice_staticId() Ice::TwowayOnlyException::~TwowayOnlyException() {} std::string_view -Ice::TwowayOnlyException::ice_staticId() +Ice::TwowayOnlyException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::TwowayOnlyException"; return typeId; @@ -76,7 +76,7 @@ Ice::TwowayOnlyException::ice_staticId() Ice::CloneNotImplementedException::~CloneNotImplementedException() {} std::string_view -Ice::CloneNotImplementedException::ice_staticId() +Ice::CloneNotImplementedException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::CloneNotImplementedException"; return typeId; @@ -85,7 +85,7 @@ Ice::CloneNotImplementedException::ice_staticId() Ice::UnknownException::~UnknownException() {} std::string_view -Ice::UnknownException::ice_staticId() +Ice::UnknownException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::UnknownException"; return typeId; @@ -94,7 +94,7 @@ Ice::UnknownException::ice_staticId() Ice::UnknownLocalException::~UnknownLocalException() {} std::string_view -Ice::UnknownLocalException::ice_staticId() +Ice::UnknownLocalException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::UnknownLocalException"; return typeId; @@ -103,7 +103,7 @@ Ice::UnknownLocalException::ice_staticId() Ice::UnknownUserException::~UnknownUserException() {} std::string_view -Ice::UnknownUserException::ice_staticId() +Ice::UnknownUserException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::UnknownUserException"; return typeId; @@ -112,7 +112,7 @@ Ice::UnknownUserException::ice_staticId() Ice::VersionMismatchException::~VersionMismatchException() {} std::string_view -Ice::VersionMismatchException::ice_staticId() +Ice::VersionMismatchException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::VersionMismatchException"; return typeId; @@ -121,7 +121,7 @@ Ice::VersionMismatchException::ice_staticId() Ice::CommunicatorDestroyedException::~CommunicatorDestroyedException() {} std::string_view -Ice::CommunicatorDestroyedException::ice_staticId() +Ice::CommunicatorDestroyedException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::CommunicatorDestroyedException"; return typeId; @@ -130,7 +130,7 @@ Ice::CommunicatorDestroyedException::ice_staticId() Ice::ObjectAdapterDeactivatedException::~ObjectAdapterDeactivatedException() {} std::string_view -Ice::ObjectAdapterDeactivatedException::ice_staticId() +Ice::ObjectAdapterDeactivatedException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ObjectAdapterDeactivatedException"; return typeId; @@ -139,7 +139,7 @@ Ice::ObjectAdapterDeactivatedException::ice_staticId() Ice::ObjectAdapterIdInUseException::~ObjectAdapterIdInUseException() {} std::string_view -Ice::ObjectAdapterIdInUseException::ice_staticId() +Ice::ObjectAdapterIdInUseException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ObjectAdapterIdInUseException"; return typeId; @@ -148,7 +148,7 @@ Ice::ObjectAdapterIdInUseException::ice_staticId() Ice::NoEndpointException::~NoEndpointException() {} std::string_view -Ice::NoEndpointException::ice_staticId() +Ice::NoEndpointException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::NoEndpointException"; return typeId; @@ -157,7 +157,7 @@ Ice::NoEndpointException::ice_staticId() Ice::EndpointParseException::~EndpointParseException() {} std::string_view -Ice::EndpointParseException::ice_staticId() +Ice::EndpointParseException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::EndpointParseException"; return typeId; @@ -166,7 +166,7 @@ Ice::EndpointParseException::ice_staticId() Ice::EndpointSelectionTypeParseException::~EndpointSelectionTypeParseException() {} std::string_view -Ice::EndpointSelectionTypeParseException::ice_staticId() +Ice::EndpointSelectionTypeParseException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::EndpointSelectionTypeParseException"; return typeId; @@ -175,7 +175,7 @@ Ice::EndpointSelectionTypeParseException::ice_staticId() Ice::VersionParseException::~VersionParseException() {} std::string_view -Ice::VersionParseException::ice_staticId() +Ice::VersionParseException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::VersionParseException"; return typeId; @@ -184,7 +184,7 @@ Ice::VersionParseException::ice_staticId() Ice::IdentityParseException::~IdentityParseException() {} std::string_view -Ice::IdentityParseException::ice_staticId() +Ice::IdentityParseException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::IdentityParseException"; return typeId; @@ -193,7 +193,7 @@ Ice::IdentityParseException::ice_staticId() Ice::ProxyParseException::~ProxyParseException() {} std::string_view -Ice::ProxyParseException::ice_staticId() +Ice::ProxyParseException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ProxyParseException"; return typeId; @@ -202,7 +202,7 @@ Ice::ProxyParseException::ice_staticId() Ice::IllegalIdentityException::~IllegalIdentityException() {} std::string_view -Ice::IllegalIdentityException::ice_staticId() +Ice::IllegalIdentityException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::IllegalIdentityException"; return typeId; @@ -211,7 +211,7 @@ Ice::IllegalIdentityException::ice_staticId() Ice::IllegalServantException::~IllegalServantException() {} std::string_view -Ice::IllegalServantException::ice_staticId() +Ice::IllegalServantException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::IllegalServantException"; return typeId; @@ -220,7 +220,7 @@ Ice::IllegalServantException::ice_staticId() Ice::RequestFailedException::~RequestFailedException() {} std::string_view -Ice::RequestFailedException::ice_staticId() +Ice::RequestFailedException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::RequestFailedException"; return typeId; @@ -229,7 +229,7 @@ Ice::RequestFailedException::ice_staticId() Ice::ObjectNotExistException::~ObjectNotExistException() {} std::string_view -Ice::ObjectNotExistException::ice_staticId() +Ice::ObjectNotExistException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ObjectNotExistException"; return typeId; @@ -238,7 +238,7 @@ Ice::ObjectNotExistException::ice_staticId() Ice::FacetNotExistException::~FacetNotExistException() {} std::string_view -Ice::FacetNotExistException::ice_staticId() +Ice::FacetNotExistException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::FacetNotExistException"; return typeId; @@ -247,7 +247,7 @@ Ice::FacetNotExistException::ice_staticId() Ice::OperationNotExistException::~OperationNotExistException() {} std::string_view -Ice::OperationNotExistException::ice_staticId() +Ice::OperationNotExistException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::OperationNotExistException"; return typeId; @@ -256,7 +256,7 @@ Ice::OperationNotExistException::ice_staticId() Ice::SyscallException::~SyscallException() {} std::string_view -Ice::SyscallException::ice_staticId() +Ice::SyscallException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::SyscallException"; return typeId; @@ -265,7 +265,7 @@ Ice::SyscallException::ice_staticId() Ice::SocketException::~SocketException() {} std::string_view -Ice::SocketException::ice_staticId() +Ice::SocketException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::SocketException"; return typeId; @@ -274,7 +274,7 @@ Ice::SocketException::ice_staticId() Ice::CFNetworkException::~CFNetworkException() {} std::string_view -Ice::CFNetworkException::ice_staticId() +Ice::CFNetworkException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::CFNetworkException"; return typeId; @@ -283,7 +283,7 @@ Ice::CFNetworkException::ice_staticId() Ice::FileException::~FileException() {} std::string_view -Ice::FileException::ice_staticId() +Ice::FileException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::FileException"; return typeId; @@ -292,7 +292,7 @@ Ice::FileException::ice_staticId() Ice::ConnectFailedException::~ConnectFailedException() {} std::string_view -Ice::ConnectFailedException::ice_staticId() +Ice::ConnectFailedException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ConnectFailedException"; return typeId; @@ -301,7 +301,7 @@ Ice::ConnectFailedException::ice_staticId() Ice::ConnectionRefusedException::~ConnectionRefusedException() {} std::string_view -Ice::ConnectionRefusedException::ice_staticId() +Ice::ConnectionRefusedException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ConnectionRefusedException"; return typeId; @@ -310,7 +310,7 @@ Ice::ConnectionRefusedException::ice_staticId() Ice::ConnectionLostException::~ConnectionLostException() {} std::string_view -Ice::ConnectionLostException::ice_staticId() +Ice::ConnectionLostException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ConnectionLostException"; return typeId; @@ -319,7 +319,7 @@ Ice::ConnectionLostException::ice_staticId() Ice::DNSException::~DNSException() {} std::string_view -Ice::DNSException::ice_staticId() +Ice::DNSException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::DNSException"; return typeId; @@ -328,7 +328,7 @@ Ice::DNSException::ice_staticId() Ice::OperationInterruptedException::~OperationInterruptedException() {} std::string_view -Ice::OperationInterruptedException::ice_staticId() +Ice::OperationInterruptedException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::OperationInterruptedException"; return typeId; @@ -337,7 +337,7 @@ Ice::OperationInterruptedException::ice_staticId() Ice::TimeoutException::~TimeoutException() {} std::string_view -Ice::TimeoutException::ice_staticId() +Ice::TimeoutException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::TimeoutException"; return typeId; @@ -346,7 +346,7 @@ Ice::TimeoutException::ice_staticId() Ice::ConnectTimeoutException::~ConnectTimeoutException() {} std::string_view -Ice::ConnectTimeoutException::ice_staticId() +Ice::ConnectTimeoutException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ConnectTimeoutException"; return typeId; @@ -355,7 +355,7 @@ Ice::ConnectTimeoutException::ice_staticId() Ice::CloseTimeoutException::~CloseTimeoutException() {} std::string_view -Ice::CloseTimeoutException::ice_staticId() +Ice::CloseTimeoutException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::CloseTimeoutException"; return typeId; @@ -364,7 +364,7 @@ Ice::CloseTimeoutException::ice_staticId() Ice::ConnectionTimeoutException::~ConnectionTimeoutException() {} std::string_view -Ice::ConnectionTimeoutException::ice_staticId() +Ice::ConnectionTimeoutException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ConnectionTimeoutException"; return typeId; @@ -373,7 +373,7 @@ Ice::ConnectionTimeoutException::ice_staticId() Ice::InvocationTimeoutException::~InvocationTimeoutException() {} std::string_view -Ice::InvocationTimeoutException::ice_staticId() +Ice::InvocationTimeoutException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::InvocationTimeoutException"; return typeId; @@ -382,7 +382,7 @@ Ice::InvocationTimeoutException::ice_staticId() Ice::InvocationCanceledException::~InvocationCanceledException() {} std::string_view -Ice::InvocationCanceledException::ice_staticId() +Ice::InvocationCanceledException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::InvocationCanceledException"; return typeId; @@ -391,7 +391,7 @@ Ice::InvocationCanceledException::ice_staticId() Ice::ProtocolException::~ProtocolException() {} std::string_view -Ice::ProtocolException::ice_staticId() +Ice::ProtocolException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ProtocolException"; return typeId; @@ -400,7 +400,7 @@ Ice::ProtocolException::ice_staticId() Ice::BadMagicException::~BadMagicException() {} std::string_view -Ice::BadMagicException::ice_staticId() +Ice::BadMagicException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::BadMagicException"; return typeId; @@ -409,7 +409,7 @@ Ice::BadMagicException::ice_staticId() Ice::UnsupportedProtocolException::~UnsupportedProtocolException() {} std::string_view -Ice::UnsupportedProtocolException::ice_staticId() +Ice::UnsupportedProtocolException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::UnsupportedProtocolException"; return typeId; @@ -418,7 +418,7 @@ Ice::UnsupportedProtocolException::ice_staticId() Ice::UnsupportedEncodingException::~UnsupportedEncodingException() {} std::string_view -Ice::UnsupportedEncodingException::ice_staticId() +Ice::UnsupportedEncodingException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::UnsupportedEncodingException"; return typeId; @@ -427,7 +427,7 @@ Ice::UnsupportedEncodingException::ice_staticId() Ice::UnknownMessageException::~UnknownMessageException() {} std::string_view -Ice::UnknownMessageException::ice_staticId() +Ice::UnknownMessageException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::UnknownMessageException"; return typeId; @@ -436,7 +436,7 @@ Ice::UnknownMessageException::ice_staticId() Ice::ConnectionNotValidatedException::~ConnectionNotValidatedException() {} std::string_view -Ice::ConnectionNotValidatedException::ice_staticId() +Ice::ConnectionNotValidatedException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ConnectionNotValidatedException"; return typeId; @@ -445,7 +445,7 @@ Ice::ConnectionNotValidatedException::ice_staticId() Ice::UnknownRequestIdException::~UnknownRequestIdException() {} std::string_view -Ice::UnknownRequestIdException::ice_staticId() +Ice::UnknownRequestIdException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::UnknownRequestIdException"; return typeId; @@ -454,7 +454,7 @@ Ice::UnknownRequestIdException::ice_staticId() Ice::UnknownReplyStatusException::~UnknownReplyStatusException() {} std::string_view -Ice::UnknownReplyStatusException::ice_staticId() +Ice::UnknownReplyStatusException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::UnknownReplyStatusException"; return typeId; @@ -463,7 +463,7 @@ Ice::UnknownReplyStatusException::ice_staticId() Ice::CloseConnectionException::~CloseConnectionException() {} std::string_view -Ice::CloseConnectionException::ice_staticId() +Ice::CloseConnectionException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::CloseConnectionException"; return typeId; @@ -472,7 +472,7 @@ Ice::CloseConnectionException::ice_staticId() Ice::ConnectionManuallyClosedException::~ConnectionManuallyClosedException() {} std::string_view -Ice::ConnectionManuallyClosedException::ice_staticId() +Ice::ConnectionManuallyClosedException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ConnectionManuallyClosedException"; return typeId; @@ -481,7 +481,7 @@ Ice::ConnectionManuallyClosedException::ice_staticId() Ice::IllegalMessageSizeException::~IllegalMessageSizeException() {} std::string_view -Ice::IllegalMessageSizeException::ice_staticId() +Ice::IllegalMessageSizeException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::IllegalMessageSizeException"; return typeId; @@ -490,7 +490,7 @@ Ice::IllegalMessageSizeException::ice_staticId() Ice::CompressionException::~CompressionException() {} std::string_view -Ice::CompressionException::ice_staticId() +Ice::CompressionException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::CompressionException"; return typeId; @@ -499,7 +499,7 @@ Ice::CompressionException::ice_staticId() Ice::DatagramLimitException::~DatagramLimitException() {} std::string_view -Ice::DatagramLimitException::ice_staticId() +Ice::DatagramLimitException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::DatagramLimitException"; return typeId; @@ -508,7 +508,7 @@ Ice::DatagramLimitException::ice_staticId() Ice::MarshalException::~MarshalException() {} std::string_view -Ice::MarshalException::ice_staticId() +Ice::MarshalException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::MarshalException"; return typeId; @@ -517,7 +517,7 @@ Ice::MarshalException::ice_staticId() Ice::ProxyUnmarshalException::~ProxyUnmarshalException() {} std::string_view -Ice::ProxyUnmarshalException::ice_staticId() +Ice::ProxyUnmarshalException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::ProxyUnmarshalException"; return typeId; @@ -526,7 +526,7 @@ Ice::ProxyUnmarshalException::ice_staticId() Ice::UnmarshalOutOfBoundsException::~UnmarshalOutOfBoundsException() {} std::string_view -Ice::UnmarshalOutOfBoundsException::ice_staticId() +Ice::UnmarshalOutOfBoundsException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::UnmarshalOutOfBoundsException"; return typeId; @@ -535,7 +535,7 @@ Ice::UnmarshalOutOfBoundsException::ice_staticId() Ice::NoValueFactoryException::~NoValueFactoryException() {} std::string_view -Ice::NoValueFactoryException::ice_staticId() +Ice::NoValueFactoryException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::NoValueFactoryException"; return typeId; @@ -544,7 +544,7 @@ Ice::NoValueFactoryException::ice_staticId() Ice::UnexpectedObjectException::~UnexpectedObjectException() {} std::string_view -Ice::UnexpectedObjectException::ice_staticId() +Ice::UnexpectedObjectException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::UnexpectedObjectException"; return typeId; @@ -553,7 +553,7 @@ Ice::UnexpectedObjectException::ice_staticId() Ice::MemoryLimitException::~MemoryLimitException() {} std::string_view -Ice::MemoryLimitException::ice_staticId() +Ice::MemoryLimitException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::MemoryLimitException"; return typeId; @@ -562,7 +562,7 @@ Ice::MemoryLimitException::ice_staticId() Ice::StringConversionException::~StringConversionException() {} std::string_view -Ice::StringConversionException::ice_staticId() +Ice::StringConversionException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::StringConversionException"; return typeId; @@ -571,7 +571,7 @@ Ice::StringConversionException::ice_staticId() Ice::EncapsulationException::~EncapsulationException() {} std::string_view -Ice::EncapsulationException::ice_staticId() +Ice::EncapsulationException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::EncapsulationException"; return typeId; @@ -580,7 +580,7 @@ Ice::EncapsulationException::ice_staticId() Ice::FeatureNotSupportedException::~FeatureNotSupportedException() {} std::string_view -Ice::FeatureNotSupportedException::ice_staticId() +Ice::FeatureNotSupportedException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::FeatureNotSupportedException"; return typeId; @@ -589,7 +589,7 @@ Ice::FeatureNotSupportedException::ice_staticId() Ice::SecurityException::~SecurityException() {} std::string_view -Ice::SecurityException::ice_staticId() +Ice::SecurityException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::SecurityException"; return typeId; @@ -598,7 +598,7 @@ Ice::SecurityException::ice_staticId() Ice::FixedProxyException::~FixedProxyException() {} std::string_view -Ice::FixedProxyException::ice_staticId() +Ice::FixedProxyException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::FixedProxyException"; return typeId; diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp index 74c4756ba28..ac25c5f0ee7 100644 --- a/cpp/src/Ice/Object.cpp +++ b/cpp/src/Ice/Object.cpp @@ -43,7 +43,7 @@ Ice::Object::ice_id(const Current&) const } string_view -Ice::Object::ice_staticId() +Ice::Object::ice_staticId() noexcept { static constexpr std::string_view typeId = "::Ice::Object"; return typeId; diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index 3cc6ff4ed42..5a274d72d0e 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -26,7 +26,7 @@ namespace Ice namespace { - inline ReferencePtr createReference(const shared_ptr& communicator, const string& proxyString) + inline ReferencePtr createReference(const shared_ptr& communicator, string_view proxyString) { if (!communicator) { @@ -42,7 +42,7 @@ namespace } } -Ice::ObjectPrx::ObjectPrx(const shared_ptr& communicator, const string& proxyString) +Ice::ObjectPrx::ObjectPrx(const shared_ptr& communicator, string_view proxyString) : ObjectPrx(createReference(communicator, proxyString)) { } @@ -75,7 +75,7 @@ Ice::ObjectPrx::ice_getIdentity() const } ObjectPrx -Ice::ObjectPrx::ice_identity(const Identity& newIdentity) const +Ice::ObjectPrx::ice_identity(Identity newIdentity) const { checkIdentity(newIdentity, __FILE__, __LINE__); if (newIdentity == _reference->getIdentity()) @@ -84,7 +84,7 @@ Ice::ObjectPrx::ice_identity(const Identity& newIdentity) const } else { - return ObjectPrx(_reference->changeIdentity(newIdentity)); + return ObjectPrx(_reference->changeIdentity(std::move(newIdentity))); } } @@ -101,7 +101,7 @@ Ice::ObjectPrx::ice_getFacet() const } ObjectPrx -Ice::ObjectPrx::ice_facet(const string& newFacet) const +Ice::ObjectPrx::ice_facet(string newFacet) const { if (newFacet == _reference->getFacet()) { @@ -109,7 +109,7 @@ Ice::ObjectPrx::ice_facet(const string& newFacet) const } else { - return ObjectPrx(_reference->changeFacet(newFacet)); + return ObjectPrx(_reference->changeFacet(std::move(newFacet))); } } @@ -260,7 +260,7 @@ Ice::ObjectPrx::ice_getCommunicator() const } string_view -Ice::ObjectPrx::ice_staticId() +Ice::ObjectPrx::ice_staticId() noexcept { static constexpr string_view typeId = "::Ice::Object"; return typeId; @@ -291,7 +291,7 @@ Ice::ObjectPrx::_write(OutputStream& os) const } ReferencePtr -Ice::ObjectPrx::_adapterId(const string& newAdapterId) const +Ice::ObjectPrx::_adapterId(string newAdapterId) const { if (newAdapterId == _reference->getAdapterId()) { @@ -299,7 +299,7 @@ Ice::ObjectPrx::_adapterId(const string& newAdapterId) const } else { - return _reference->changeAdapterId(newAdapterId); + return _reference->changeAdapterId(std::move(newAdapterId)); } } @@ -370,9 +370,9 @@ Ice::ObjectPrx::_connectionCached(bool newCache) const } ReferencePtr -Ice::ObjectPrx::_connectionId(const string& id) const +Ice::ObjectPrx::_connectionId(string id) const { - ReferencePtr ref = _reference->changeConnectionId(id); + ReferencePtr ref = _reference->changeConnectionId(std::move(id)); if (targetEqualTo(ref, _reference)) { return _reference; @@ -384,9 +384,9 @@ Ice::ObjectPrx::_connectionId(const string& id) const } ReferencePtr -Ice::ObjectPrx::_context(const Context& newContext) const +Ice::ObjectPrx::_context(Context newContext) const { - return _reference->changeContext(newContext); + return _reference->changeContext(std::move(newContext)); } ReferencePtr @@ -403,7 +403,7 @@ Ice::ObjectPrx::_datagram() const } ReferencePtr -Ice::ObjectPrx::_encodingVersion(const ::Ice::EncodingVersion& encoding) const +Ice::ObjectPrx::_encodingVersion(EncodingVersion encoding) const { if (encoding == _reference->getEncoding()) { @@ -411,7 +411,7 @@ Ice::ObjectPrx::_encodingVersion(const ::Ice::EncodingVersion& encoding) const } else { - return _reference->changeEncoding(encoding); + return _reference->changeEncoding(std::move(encoding)); } } @@ -429,7 +429,7 @@ Ice::ObjectPrx::_endpointSelection(EndpointSelectionType newType) const } ReferencePtr -Ice::ObjectPrx::_endpoints(const EndpointSeq& newEndpoints) const +Ice::ObjectPrx::_endpoints(EndpointSeq newEndpoints) const { vector endpoints; for (EndpointSeq::const_iterator p = newEndpoints.begin(); p != newEndpoints.end(); ++p) @@ -450,12 +450,12 @@ Ice::ObjectPrx::_endpoints(const EndpointSeq& newEndpoints) const } else { - return _reference->changeEndpoints(endpoints); + return _reference->changeEndpoints(std::move(endpoints)); } } ReferencePtr -Ice::ObjectPrx::_fixed(const ::Ice::ConnectionPtr& connection) const +Ice::ObjectPrx::_fixed(ConnectionPtr connection) const { if (!connection) { @@ -466,7 +466,7 @@ Ice::ObjectPrx::_fixed(const ::Ice::ConnectionPtr& connection) const { throw invalid_argument("invalid connection passed to ice_fixed"); } - ReferencePtr ref = _reference->changeConnection(impl); + ReferencePtr ref = _reference->changeConnection(std::move(impl)); if (targetEqualTo(ref, _reference)) { return _reference; diff --git a/cpp/src/Ice/ProxyAsync.cpp b/cpp/src/Ice/ProxyAsync.cpp index 3ab8e4057e7..1596029d7d6 100644 --- a/cpp/src/Ice/ProxyAsync.cpp +++ b/cpp/src/Ice/ProxyAsync.cpp @@ -485,7 +485,7 @@ Ice::ObjectPrx::ice_invoke( std::future>> Ice::ObjectPrx::ice_invokeAsync( - const string& operation, + string_view operation, Ice::OperationMode mode, const vector& inParams, const Ice::Context& context) const @@ -537,7 +537,7 @@ Ice::ObjectPrx::ice_invoke( std::future>> Ice::ObjectPrx::ice_invokeAsync( - const string& operation, + string_view operation, Ice::OperationMode mode, const std::pair& inParams, const Ice::Context& context) const diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index f576439e5ab..880f5bcf54c 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -42,10 +42,10 @@ IceInternal::Reference::getCommunicator() const } ReferencePtr -IceInternal::Reference::changeContext(const Context& newContext) const +IceInternal::Reference::changeContext(Context newContext) const { ReferencePtr r = clone(); - r->_context = make_shared(newContext); + r->_context = make_shared(std::move(newContext)); return r; } @@ -66,18 +66,18 @@ IceInternal::Reference::changeSecure(bool newSecure) const } ReferencePtr -IceInternal::Reference::changeIdentity(const Identity& newIdentity) const +IceInternal::Reference::changeIdentity(Identity newIdentity) const { ReferencePtr r = clone(); - r->_identity = newIdentity; + r->_identity = std::move(newIdentity); return r; } ReferencePtr -IceInternal::Reference::changeFacet(const string& newFacet) const +IceInternal::Reference::changeFacet(string newFacet) const { ReferencePtr r = clone(); - r->_facet = newFacet; + r->_facet = std::move(newFacet); return r; } @@ -90,10 +90,10 @@ IceInternal::Reference::changeInvocationTimeout(int invocationTimeout) const } ReferencePtr -IceInternal::Reference::changeEncoding(const Ice::EncodingVersion& encoding) const +IceInternal::Reference::changeEncoding(Ice::EncodingVersion encoding) const { ReferencePtr r = clone(); - r->_encoding = encoding; + r->_encoding = std::move(encoding); return r; } @@ -516,12 +516,12 @@ IceInternal::FixedReference::FixedReference( bool secure, const ProtocolVersion& protocol, const EncodingVersion& encoding, - const ConnectionIPtr& fixedConnection, + ConnectionIPtr fixedConnection, int invocationTimeout, const Ice::Context& context, const optional& compress) : Reference(instance, communicator, id, facet, mode, secure, protocol, encoding, invocationTimeout, context), - _fixedConnection(fixedConnection) + _fixedConnection(std::move(fixedConnection)) { if (compress) { @@ -585,25 +585,25 @@ IceInternal::FixedReference::getTimeout() const } ReferencePtr -IceInternal::FixedReference::changeEndpoints(const vector& /*newEndpoints*/) const +IceInternal::FixedReference::changeEndpoints(vector /*newEndpoints*/) const { throw FixedProxyException(__FILE__, __LINE__); } ReferencePtr -IceInternal::FixedReference::changeAdapterId(const string& /*newAdapterId*/) const +IceInternal::FixedReference::changeAdapterId(string /*newAdapterId*/) const { throw FixedProxyException(__FILE__, __LINE__); } ReferencePtr -IceInternal::FixedReference::changeLocator(const optional&) const +IceInternal::FixedReference::changeLocator(optional) const { throw FixedProxyException(__FILE__, __LINE__); } ReferencePtr -IceInternal::FixedReference::changeRouter(const optional&) const +IceInternal::FixedReference::changeRouter(optional) const { throw FixedProxyException(__FILE__, __LINE__); } @@ -645,16 +645,16 @@ IceInternal::FixedReference::changeTimeout(int) const } ReferencePtr -IceInternal::FixedReference::changeConnectionId(const string&) const +IceInternal::FixedReference::changeConnectionId(string) const { throw FixedProxyException(__FILE__, __LINE__); } ReferencePtr -IceInternal::FixedReference::changeConnection(const Ice::ConnectionIPtr& newConnection) const +IceInternal::FixedReference::changeConnection(Ice::ConnectionIPtr newConnection) const { FixedReferencePtr r = dynamic_pointer_cast(clone()); - r->_fixedConnection = newConnection; + r->_fixedConnection = std::move(newConnection); return r; } @@ -917,7 +917,7 @@ IceInternal::RoutableReference::changeMode(Mode newMode) const } ReferencePtr -IceInternal::RoutableReference::changeEncoding(const Ice::EncodingVersion& encoding) const +IceInternal::RoutableReference::changeEncoding(Ice::EncodingVersion encoding) const { ReferencePtr r = Reference::changeEncoding(encoding); if (r.get() != const_cast(this)) @@ -949,39 +949,39 @@ IceInternal::RoutableReference::changeCompress(bool newCompress) const } ReferencePtr -IceInternal::RoutableReference::changeEndpoints(const vector& newEndpoints) const +IceInternal::RoutableReference::changeEndpoints(vector newEndpoints) const { RoutableReferencePtr r = dynamic_pointer_cast(clone()); - r->_endpoints = newEndpoints; + r->_endpoints = std::move(newEndpoints); r->applyOverrides(r->_endpoints); r->_adapterId.clear(); return r; } ReferencePtr -IceInternal::RoutableReference::changeAdapterId(const string& newAdapterId) const +IceInternal::RoutableReference::changeAdapterId(string newAdapterId) const { RoutableReferencePtr r = dynamic_pointer_cast(clone()); - r->_adapterId = newAdapterId; + r->_adapterId = std::move(newAdapterId); r->_endpoints.clear(); return r; } ReferencePtr -IceInternal::RoutableReference::changeLocator(const optional& newLocator) const +IceInternal::RoutableReference::changeLocator(optional newLocator) const { LocatorInfoPtr newLocatorInfo = newLocator ? getInstance()->locatorManager()->get(newLocator.value()) : nullptr; RoutableReferencePtr r = dynamic_pointer_cast(clone()); - r->_locatorInfo = newLocatorInfo; + r->_locatorInfo = std::move(newLocatorInfo); return r; } ReferencePtr -IceInternal::RoutableReference::changeRouter(const optional& newRouter) const +IceInternal::RoutableReference::changeRouter(optional newRouter) const { RouterInfoPtr newRouterInfo = newRouter ? getInstance()->routerManager()->get(newRouter.value()) : nullptr; RoutableReferencePtr r = dynamic_pointer_cast(clone()); - r->_routerInfo = newRouterInfo; + r->_routerInfo = std::move(newRouterInfo); return r; } @@ -1044,7 +1044,7 @@ IceInternal::RoutableReference::changeTimeout(int newTimeout) const } ReferencePtr -IceInternal::RoutableReference::changeConnectionId(const string& id) const +IceInternal::RoutableReference::changeConnectionId(string id) const { RoutableReferencePtr r = dynamic_pointer_cast(clone()); r->_connectionId = id; @@ -1061,7 +1061,7 @@ IceInternal::RoutableReference::changeConnectionId(const string& id) const } ReferencePtr -IceInternal::RoutableReference::changeConnection(const Ice::ConnectionIPtr& connection) const +IceInternal::RoutableReference::changeConnection(Ice::ConnectionIPtr connection) const { return make_shared( getInstance(), @@ -1072,7 +1072,7 @@ IceInternal::RoutableReference::changeConnection(const Ice::ConnectionIPtr& conn getSecure(), getProtocol(), getEncoding(), - connection, + std::move(connection), getInvocationTimeout(), getContext()->getValue(), getCompress()); diff --git a/cpp/src/Ice/Reference.h b/cpp/src/Ice/Reference.h index 07258e1b528..1b56a1d3279 100644 --- a/cpp/src/Ice/Reference.h +++ b/cpp/src/Ice/Reference.h @@ -80,19 +80,19 @@ namespace IceInternal // a new reference based on the existing one, with the // corresponding value changed. // - ReferencePtr changeContext(const Ice::Context&) const; + ReferencePtr changeContext(Ice::Context) const; ReferencePtr changeSecure(bool) const; - ReferencePtr changeIdentity(const Ice::Identity&) const; - ReferencePtr changeFacet(const std::string&) const; + ReferencePtr changeIdentity(Ice::Identity) const; + ReferencePtr changeFacet(std::string) const; ReferencePtr changeInvocationTimeout(int) const; - virtual ReferencePtr changeEncoding(const Ice::EncodingVersion&) const; + virtual ReferencePtr changeEncoding(Ice::EncodingVersion) const; virtual ReferencePtr changeCompress(bool) const; virtual ReferencePtr changeMode(Mode) const; - virtual ReferencePtr changeEndpoints(const std::vector&) const = 0; - virtual ReferencePtr changeAdapterId(const std::string&) const = 0; - virtual ReferencePtr changeLocator(const std::optional&) const = 0; - virtual ReferencePtr changeRouter(const std::optional&) const = 0; + virtual ReferencePtr changeEndpoints(std::vector) const = 0; + virtual ReferencePtr changeAdapterId(std::string) const = 0; + virtual ReferencePtr changeLocator(std::optional) const = 0; + virtual ReferencePtr changeRouter(std::optional) const = 0; virtual ReferencePtr changeCollocationOptimized(bool) const = 0; virtual ReferencePtr changeLocatorCacheTimeout(int) const = 0; virtual ReferencePtr changeCacheConnection(bool) const = 0; @@ -100,8 +100,8 @@ namespace IceInternal virtual ReferencePtr changeEndpointSelection(Ice::EndpointSelectionType) const = 0; virtual ReferencePtr changeTimeout(int) const = 0; - virtual ReferencePtr changeConnectionId(const std::string&) const = 0; - virtual ReferencePtr changeConnection(const Ice::ConnectionIPtr&) const = 0; + virtual ReferencePtr changeConnectionId(std::string) const = 0; + virtual ReferencePtr changeConnection(Ice::ConnectionIPtr) const = 0; int hash() const; // Conceptually const. @@ -191,7 +191,7 @@ namespace IceInternal bool, const Ice::ProtocolVersion&, const Ice::EncodingVersion&, - const Ice::ConnectionIPtr&, + Ice::ConnectionIPtr, int, const Ice::Context&, const std::optional&); @@ -208,10 +208,10 @@ namespace IceInternal std::string getConnectionId() const final; std::optional getTimeout() const final; - ReferencePtr changeEndpoints(const std::vector&) const final; - ReferencePtr changeAdapterId(const std::string&) const final; - ReferencePtr changeLocator(const std::optional&) const final; - ReferencePtr changeRouter(const std::optional&) const final; + ReferencePtr changeEndpoints(std::vector) const final; + ReferencePtr changeAdapterId(std::string) const final; + ReferencePtr changeLocator(std::optional) const final; + ReferencePtr changeRouter(std::optional) const final; ReferencePtr changeCollocationOptimized(bool) const final; ReferencePtr changeCacheConnection(bool) const final; ReferencePtr changePreferSecure(bool) const final; @@ -219,8 +219,8 @@ namespace IceInternal ReferencePtr changeLocatorCacheTimeout(int) const final; ReferencePtr changeTimeout(int) const final; - ReferencePtr changeConnectionId(const std::string&) const final; - ReferencePtr changeConnection(const Ice::ConnectionIPtr&) const final; + ReferencePtr changeConnectionId(std::string) const final; + ReferencePtr changeConnection(Ice::ConnectionIPtr) const final; bool isIndirect() const final; bool isWellKnown() const final; @@ -280,13 +280,13 @@ namespace IceInternal std::string getConnectionId() const final; std::optional getTimeout() const final; - ReferencePtr changeEncoding(const Ice::EncodingVersion&) const final; + ReferencePtr changeEncoding(Ice::EncodingVersion) const final; ReferencePtr changeCompress(bool) const final; ReferencePtr changeMode(Mode) const final; - ReferencePtr changeEndpoints(const std::vector&) const final; - ReferencePtr changeAdapterId(const std::string&) const final; - ReferencePtr changeLocator(const std::optional&) const final; - ReferencePtr changeRouter(const std::optional&) const final; + ReferencePtr changeEndpoints(std::vector) const final; + ReferencePtr changeAdapterId(std::string) const final; + ReferencePtr changeLocator(std::optional) const final; + ReferencePtr changeRouter(std::optional) const final; ReferencePtr changeCollocationOptimized(bool) const final; ReferencePtr changeCacheConnection(bool) const final; ReferencePtr changePreferSecure(bool) const final; @@ -294,8 +294,8 @@ namespace IceInternal ReferencePtr changeLocatorCacheTimeout(int) const final; ReferencePtr changeTimeout(int) const final; - ReferencePtr changeConnectionId(const std::string&) const final; - ReferencePtr changeConnection(const Ice::ConnectionIPtr&) const final; + ReferencePtr changeConnectionId(std::string) const final; + ReferencePtr changeConnection(Ice::ConnectionIPtr) const final; bool isIndirect() const final; bool isWellKnown() const final; diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp index fddb796b182..742116474e5 100644 --- a/cpp/src/Ice/ReferenceFactory.cpp +++ b/cpp/src/Ice/ReferenceFactory.cpp @@ -92,7 +92,7 @@ IceInternal::ReferenceFactory::create(const Identity& ident, const Ice::Connecti } ReferencePtr -IceInternal::ReferenceFactory::create(const string& str, const string& propertyPrefix) +IceInternal::ReferenceFactory::create(string_view str, const string& propertyPrefix) { if (str.empty()) { diff --git a/cpp/src/Ice/ReferenceFactory.h b/cpp/src/Ice/ReferenceFactory.h index b5b3bdde839..3d5317d4ae2 100644 --- a/cpp/src/Ice/ReferenceFactory.h +++ b/cpp/src/Ice/ReferenceFactory.h @@ -36,7 +36,7 @@ namespace IceInternal // // Create a reference from a string. // - ReferencePtr create(const ::std::string& proxyString, const std::string& prefix); + ReferencePtr create(std::string_view proxyString, const std::string& prefix); // // Create a reference by unmarshaling it from a stream. diff --git a/cpp/src/Ice/Value.cpp b/cpp/src/Ice/Value.cpp index 38cf74c09a3..2b247c4738e 100644 --- a/cpp/src/Ice/Value.cpp +++ b/cpp/src/Ice/Value.cpp @@ -45,7 +45,7 @@ Ice::Value::ice_id() const } string_view -Ice::Value::ice_staticId() +Ice::Value::ice_staticId() noexcept { static constexpr string_view typeId = "::Ice::Object"; return typeId; diff --git a/cpp/src/IceBT/Types.cpp b/cpp/src/IceBT/Types.cpp index 94602a2343a..7a59c39c575 100644 --- a/cpp/src/IceBT/Types.cpp +++ b/cpp/src/IceBT/Types.cpp @@ -20,7 +20,7 @@ IceBT::BluetoothException::~BluetoothException() {} std::string_view -IceBT::BluetoothException::ice_staticId() +IceBT::BluetoothException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::IceBT::BluetoothException"; return typeId; diff --git a/cpp/src/IceBox/Service.cpp b/cpp/src/IceBox/Service.cpp index 13fd1037a0e..8e6cbc541bc 100644 --- a/cpp/src/IceBox/Service.cpp +++ b/cpp/src/IceBox/Service.cpp @@ -25,7 +25,7 @@ IceBox::FailureException::~FailureException() {} std::string_view -IceBox::FailureException::ice_staticId() +IceBox::FailureException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::IceBox::FailureException"; return typeId; diff --git a/cpp/src/IceGrid/SynchronizationException.cpp b/cpp/src/IceGrid/SynchronizationException.cpp index a4e817d6ee0..15f22605af6 100644 --- a/cpp/src/IceGrid/SynchronizationException.cpp +++ b/cpp/src/IceGrid/SynchronizationException.cpp @@ -9,7 +9,7 @@ IceGrid::SynchronizationException::~SynchronizationException() {} std::string_view -IceGrid::SynchronizationException::ice_staticId() +IceGrid::SynchronizationException::ice_staticId() noexcept { static constexpr std::string_view typeId = "::IceGrid::SynchronizationException"; return typeId; diff --git a/cpp/src/IceGrid/SynchronizationException.h b/cpp/src/IceGrid/SynchronizationException.h index e261c96fe0c..8cbaebf5700 100644 --- a/cpp/src/IceGrid/SynchronizationException.h +++ b/cpp/src/IceGrid/SynchronizationException.h @@ -37,6 +37,6 @@ namespace IceGrid * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - static ::std::string_view ice_staticId(); + static ::std::string_view ice_staticId() noexcept; }; } diff --git a/cpp/src/IceStorm/SendQueueSizeMaxReached.cpp b/cpp/src/IceStorm/SendQueueSizeMaxReached.cpp index 2c53213218b..82da3e9f52a 100644 --- a/cpp/src/IceStorm/SendQueueSizeMaxReached.cpp +++ b/cpp/src/IceStorm/SendQueueSizeMaxReached.cpp @@ -9,7 +9,7 @@ IceStorm::SendQueueSizeMaxReached::~SendQueueSizeMaxReached() {} std::string_view -IceStorm::SendQueueSizeMaxReached::ice_staticId() +IceStorm::SendQueueSizeMaxReached::ice_staticId() noexcept { static constexpr std::string_view typeId = "::IceStorm::SendQueueSizeMaxReached"; return typeId; diff --git a/cpp/src/IceStorm/SendQueueSizeMaxReached.h b/cpp/src/IceStorm/SendQueueSizeMaxReached.h index 8aec16191e3..158cc963b8f 100644 --- a/cpp/src/IceStorm/SendQueueSizeMaxReached.h +++ b/cpp/src/IceStorm/SendQueueSizeMaxReached.h @@ -37,6 +37,6 @@ namespace IceStorm * Obtains the Slice type ID of this exception. * @return The fully-scoped type ID. */ - static ::std::string_view ice_staticId(); + static ::std::string_view ice_staticId() noexcept; }; } diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 6e33136f4ee..13fdc70f295 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -1545,7 +1545,7 @@ Slice::Gen::ProxyVisitor::visitInterfaceDefEnd(const InterfaceDefPtr& p) H << nl << " * Obtains the Slice type ID of this interface."; H << nl << " * @return The fully-scoped type ID."; H << nl << " */"; - H << nl << "static ::std::string_view ice_staticId();"; + H << nl << "static ::std::string_view ice_staticId() noexcept;"; if (!bases.empty()) { @@ -1574,8 +1574,7 @@ Slice::Gen::ProxyVisitor::visitInterfaceDefEnd(const InterfaceDefPtr& p) H << nl << prx << "(" << prx << "&& other) noexcept : ::Ice::ObjectPrx(::std::move(other))"; H << sb << eb; H << sp; - H << nl << prx - << "(const ::std::shared_ptr<::Ice::Communicator>& communicator, const ::std::string& proxyString) :"; + H << nl << prx << "(const ::std::shared_ptr<::Ice::Communicator>& communicator, std::string_view proxyString) :"; H.inc(); H << nl << "::Ice::ObjectPrx(communicator, proxyString)"; H.dec(); @@ -1621,7 +1620,7 @@ Slice::Gen::ProxyVisitor::visitInterfaceDefEnd(const InterfaceDefPtr& p) H << eb << ';'; C << sp; - C << nl << "::std::string_view" << nl << scoped.substr(2) << "::ice_staticId()"; + C << nl << "::std::string_view" << nl << scoped.substr(2) << "::ice_staticId() noexcept"; C << sb; C << nl << "static constexpr ::std::string_view typeId = \"" << p->scoped() << "\";"; C << nl << "return typeId;"; @@ -1993,7 +1992,7 @@ Slice::Gen::ProxyVisitor::emitOperationImpl( Slice::Gen::DataDefVisitor::DataDefVisitor( IceUtilInternal::Output& h, IceUtilInternal::Output& c, - const std::string& dllExport) + const string& dllExport) : H(h), C(c), _dllExport(dllExport), @@ -2086,7 +2085,6 @@ Slice::Gen::DataDefVisitor::visitExceptionStart(const ExceptionPtr& p) vector params; vector allParamDecls; - vector baseParams; map allComments; for (DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) @@ -2096,7 +2094,7 @@ Slice::Gen::DataDefVisitor::visitExceptionStart(const ExceptionPtr& p) for (DataMemberList::const_iterator q = allDataMembers.begin(); q != allDataMembers.end(); ++q) { - string typeName = inputTypeToString((*q)->type(), (*q)->optional(), scope, (*q)->getMetaData(), _useWstring); + string typeName = typeToString((*q)->type(), (*q)->optional(), scope, (*q)->getMetaData(), _useWstring); allParamDecls.push_back(typeName + " " + fixKwd((*q)->name())); CommentPtr comment = (*q)->parseComment(false); @@ -2109,10 +2107,6 @@ Slice::Gen::DataDefVisitor::visitExceptionStart(const ExceptionPtr& p) if (base) { baseDataMembers = base->allDataMembers(); - for (DataMemberList::const_iterator q = baseDataMembers.begin(); q != baseDataMembers.end(); ++q) - { - baseParams.push_back(fixKwd((*q)->name())); - } } string helperClass = getUnqualified("::Ice::UserExceptionHelper", scope); @@ -2129,19 +2123,10 @@ Slice::Gen::DataDefVisitor::visitExceptionStart(const ExceptionPtr& p) H << nl << "public:"; H.inc(); - // Out of line dtor to avoid weak vtable - H << sp << nl << _dllMemberExport << "virtual ~" << name << "();"; - + H << sp << nl << name << "() noexcept = default;"; // Default copy ctor H << sp << nl << name << "(const " << name << "&) = default;"; - C << sp; - C << nl << scoped.substr(2) << "::~" << name << "()"; - C << sb; - C << eb; - - H << sp << nl << name << "() = default;"; - if (!allDataMembers.empty()) { H << sp; @@ -2166,7 +2151,7 @@ Slice::Gen::DataDefVisitor::visitExceptionStart(const ExceptionPtr& p) } H << (*q); } - H << ") :"; + H << ") noexcept :"; H.inc(); if (base || !baseDataMembers.empty()) { @@ -2178,7 +2163,9 @@ Slice::Gen::DataDefVisitor::visitExceptionStart(const ExceptionPtr& p) { H << ", "; } - H << fixKwd((*q)->name()); + string memberName = fixKwd((*q)->name()); + TypePtr memberType = (*q)->type(); + H << condMove(isMovable(memberType), memberName); } H << ")"; @@ -2191,11 +2178,13 @@ Slice::Gen::DataDefVisitor::visitExceptionStart(const ExceptionPtr& p) for (DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { string memberName = fixKwd((*q)->name()); + TypePtr memberType = (*q)->type(); + if (q != dataMembers.begin()) { H << ","; } - H << nl << memberName << "(" << memberName << ")"; + H << nl << memberName << "(" << condMove(isMovable(memberType), memberName) << ")"; } H.dec(); @@ -2215,9 +2204,9 @@ Slice::Gen::DataDefVisitor::visitExceptionStart(const ExceptionPtr& p) H << nl << " * Obtains the Slice type ID of this exception."; H << nl << " * @return The fully-scoped type ID."; H << nl << " */"; - H << nl << _dllMemberExport << "static ::std::string_view ice_staticId();"; + H << nl << _dllMemberExport << "static ::std::string_view ice_staticId() noexcept;"; - C << sp << nl << "::std::string_view" << nl << scoped.substr(2) << "::ice_staticId()"; + C << sp << nl << "::std::string_view" << nl << scoped.substr(2) << "::ice_staticId() noexcept"; C << sb; C << nl << "static constexpr ::std::string_view typeId = \"" << p->scoped() << "\";"; C << nl << "return typeId;"; @@ -2319,13 +2308,6 @@ Slice::Gen::DataDefVisitor::visitClassDefStart(const ClassDefPtr& p) H << nl << "public:" << sp; H.inc(); - // Out of line dtor to avoid weak vtable - H << nl << _dllMemberExport << "virtual ~" << name << "();"; - C << sp; - C << nl << scoped.substr(2) << "::~" << name << "()"; - C << sb; - C << eb; - vector params; for (DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) @@ -2333,9 +2315,8 @@ Slice::Gen::DataDefVisitor::visitClassDefStart(const ClassDefPtr& p) params.push_back(fixKwd((*q)->name())); } - H << sp << nl << name << "() = default;"; - - H << sp << nl << name << "(const " << name << "&) = default;"; + H << nl << name << "() = default;"; + H << nl << name << "(const " << name << "&) = default;"; H << nl << name << "(" << name << "&&) = default;"; H << nl << name << "& operator=(const " << name << "&) = default;"; H << nl << name << "& operator=(" << name << "&&) = default;"; @@ -2354,7 +2335,7 @@ Slice::Gen::DataDefVisitor::visitClassDefStart(const ClassDefPtr& p) H << nl << " * Obtains the Slice type ID of this value."; H << nl << " * @return The fully-scoped type ID."; H << nl << " */"; - H << nl << _dllMemberExport << "static ::std::string_view ice_staticId();"; + H << nl << _dllMemberExport << "static ::std::string_view ice_staticId() noexcept;"; return true; } @@ -2366,7 +2347,7 @@ Slice::Gen::DataDefVisitor::visitClassDefEnd(const ClassDefPtr& p) ClassDefPtr base = p->base(); C << sp; - C << nl << "::std::string_view" << nl << scoped.substr(2) << "::ice_staticId()"; + C << nl << "::std::string_view" << nl << scoped.substr(2) << "::ice_staticId() noexcept"; C << sb; C << nl << "static constexpr ::std::string_view typeId = \"" << p->scoped() << "\";"; C << nl << "return typeId;"; @@ -2472,11 +2453,13 @@ Slice::Gen::DataDefVisitor::emitBaseInitializers(const ClassDefPtr& p) string upcall = "("; for (DataMemberList::const_iterator q = allBaseDataMembers.begin(); q != allBaseDataMembers.end(); ++q) { + string memberName = fixKwd((*q)->name()); + TypePtr memberType = (*q)->type(); if (q != allBaseDataMembers.begin()) { upcall += ", "; } - upcall += "" + fixKwd((*q)->name()); + upcall += condMove(isMovable(memberType), memberName); } upcall += ")"; @@ -2502,8 +2485,7 @@ Slice::Gen::DataDefVisitor::emitOneShotConstructor(const ClassDefPtr& p) for (DataMemberList::const_iterator q = allDataMembers.begin(); q != allDataMembers.end(); ++q) { - string typeName = - inputTypeToString((*q)->type(), (*q)->optional(), scope, (*q)->getMetaData(), _useWstring); + string typeName = typeToString((*q)->type(), (*q)->optional(), scope, (*q)->getMetaData(), _useWstring); allParamDecls.push_back(typeName + " " + fixKwd((*q)->name())); CommentPtr comment = (*q)->parseComment(false); if (comment) @@ -2554,7 +2536,8 @@ Slice::Gen::DataDefVisitor::emitOneShotConstructor(const ClassDefPtr& p) H << ',' << nl; } string memberName = fixKwd((*q)->name()); - H << memberName << "(" << memberName << ')'; + TypePtr memberType = (*q)->type(); + H << memberName << "(" << condMove(isMovable(memberType), memberName) << ')'; } H.dec(); @@ -2602,7 +2585,7 @@ Slice::Gen::DataDefVisitor::emitDataMember(const DataMemberPtr& p) Slice::Gen::InterfaceVisitor::InterfaceVisitor( ::IceUtilInternal::Output& h, ::IceUtilInternal::Output& c, - const std::string& dllExport) + const string& dllExport) : H(h), C(c), _dllExport(dllExport), @@ -2701,7 +2684,7 @@ Slice::Gen::InterfaceVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p) H << nl << " * Obtains the Slice type ID corresponding to this interface."; H << nl << " * @return A fully-scoped type ID."; H << nl << " */"; - H << nl << "static ::std::string_view ice_staticId();"; + H << nl << "static ::std::string_view ice_staticId() noexcept;"; C << sp; C << nl << "::std::vector<::std::string>" << nl << scoped.substr(2) << "::ice_ids(const " @@ -2729,7 +2712,7 @@ Slice::Gen::InterfaceVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p) C << eb; C << sp; - C << nl << "::std::string_view" << nl << scoped.substr(2) << "::ice_staticId()"; + C << nl << "::std::string_view" << nl << scoped.substr(2) << "::ice_staticId() noexcept"; C << sb; C << nl << "static constexpr ::std::string_view typeId = \"" << p->scoped() << "\";"; C << nl << "return typeId;";