Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE_CPLUSPLUS usage cleanup #1661

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cpp/include/Ice/MetricsObserverI.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ template<typename T> class MetricsHelperT
memberFn)));
}

#if ICE_CPLUSPLUS >= 201703L
//
// Since C++17 the noexcept-specification is part of the function type and we need a separate
// overload to handle memberFn being noexcept
Expand All @@ -138,7 +137,6 @@ template<typename T> class MetricsHelperT
Resolver*>::value_type(name, new MemberFunctionResolver<I, O, Y>(name, getFn,
memberFn)));
}
#endif

private:

Expand Down
15 changes: 0 additions & 15 deletions cpp/include/Ice/OutgoingAsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,7 @@ class LambdaOutgoing : public OutgoingAsyncT<R>, public LambdaInvoke
std::function<void(bool)> sent) :
OutgoingAsyncT<R>(proxy, false), LambdaInvoke(std::move(ex), std::move(sent))
{
#if ICE_CPLUSPLUS >= 201402L
// Move capture with C++14
_response = [this, response = std::move(response)](bool ok)
#else
_response = [this, response](bool ok)
#endif
{
if(!ok)
{
Expand Down Expand Up @@ -504,12 +499,7 @@ class LambdaOutgoing<void> : public OutgoingAsyncT<void>, public LambdaInvoke
std::function<void(bool)> sent) :
OutgoingAsyncT<void>(proxy, false), LambdaInvoke(std::move(ex), std::move(sent))
{
#if ICE_CPLUSPLUS >= 201402L
// Move capture with C++14
_response = [this, response = std::move(response)](bool ok)
#else
_response = [this, response](bool ok)
#endif
{
if(!ok)
{
Expand Down Expand Up @@ -545,12 +535,7 @@ class CustomLambdaOutgoing : public OutgoingAsync, public LambdaInvoke
std::function<void(bool)> sent) :
OutgoingAsync(proxy, false), LambdaInvoke(std::move(ex), std::move(sent))
{
#if ICE_CPLUSPLUS >= 201402L
// Move capture with C++14
_response = [this, read = std::move(read)](bool ok)
#else
_response = [this, read](bool ok)
#endif
{
if(!ok)
{
Expand Down
41 changes: 0 additions & 41 deletions cpp/include/Ice/Proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,7 @@ class InvokeLambdaOutgoing : public InvokeOutgoingAsyncT<R>, public LambdaInvoke
{
if(response)
{
#if ICE_CPLUSPLUS >= 201402L
// Move capture with C++14
_response = [this, response = std::move(response)](bool ok)
#else
_response = [this, response](bool ok)
#endif
{
if(this->_is.b.empty())
{
Expand Down Expand Up @@ -221,11 +216,7 @@ class ProxyGetConnectionLambda : public ProxyGetConnection, public LambdaInvoke
::std::function<void(bool)> sent) :
ProxyGetConnection(proxy), LambdaInvoke(::std::move(ex), ::std::move(sent))
{
#if ICE_CPLUSPLUS >= 201402L
_response = [&, response = std::move(response)](bool)
#else
_response = [&, response](bool)
#endif
{
response(getConnection());
};
Expand Down Expand Up @@ -577,11 +568,7 @@ class ICE_API ObjectPrx : public ::std::enable_shared_from_this<ObjectPrx>
::std::function<void(::Ice::Object::Ice_invokeResult&&)> r;
if(response)
{
#if ICE_CPLUSPLUS >= 201402L
r = [response = std::move(response)](::Ice::Object::Ice_invokeResult&& result)
#else
r = [response](::Ice::Object::Ice_invokeResult&& result)
#endif
{
response(result.returnValue, std::move(result.outParams));
};
Expand Down Expand Up @@ -667,11 +654,7 @@ class ICE_API ObjectPrx : public ::std::enable_shared_from_this<ObjectPrx>
::std::function<void(Result&&)> r;
if(response)
{
#if ICE_CPLUSPLUS >= 201402L
r = [response = std::move(response)](Result&& result)
#else
r = [response](Result&& result)
#endif
{
response(::std::get<0>(result), ::std::move(::std::get<1>(result)));
};
Expand Down Expand Up @@ -1460,9 +1443,6 @@ ICE_API bool proxyIdentityAndFacetEqual(const ::std::shared_ptr<ObjectPrx>& lhs,
*/

struct ProxyIdentityLess
#if (ICE_CPLUSPLUS < 201703L)
: std::binary_function<bool, ::std::shared_ptr<ObjectPrx>&, ::std::shared_ptr<ObjectPrx>&>
#endif
{
bool operator()(const ::std::shared_ptr<ObjectPrx>& lhs, const ::std::shared_ptr<ObjectPrx>& rhs) const
{
Expand All @@ -1476,9 +1456,6 @@ struct ProxyIdentityLess
* \headerfile Ice/Ice.h
*/
struct ProxyIdentityEqual
#if (ICE_CPLUSPLUS < 201703L)
: std::binary_function<bool, ::std::shared_ptr<ObjectPrx>&, ::std::shared_ptr<ObjectPrx>&>
#endif
{
bool operator()(const ::std::shared_ptr<ObjectPrx>& lhs, const ::std::shared_ptr<ObjectPrx>& rhs) const
{
Expand All @@ -1492,9 +1469,6 @@ struct ProxyIdentityEqual
* \headerfile Ice/Ice.h
*/
struct ProxyIdentityAndFacetLess
#if (ICE_CPLUSPLUS < 201703L)
: std::binary_function<bool, ::std::shared_ptr<ObjectPrx>&, ::std::shared_ptr<ObjectPrx>&>
#endif
{
bool operator()(const ::std::shared_ptr<ObjectPrx>& lhs, const ::std::shared_ptr<ObjectPrx>& rhs) const
{
Expand All @@ -1508,9 +1482,6 @@ struct ProxyIdentityAndFacetLess
* \headerfile Ice/Ice.h
*/
struct ProxyIdentityAndFacetEqual
#if (ICE_CPLUSPLUS < 201703L)
: std::binary_function<bool, ::std::shared_ptr<ObjectPrx>&, ::std::shared_ptr<ObjectPrx>&>
#endif
{
bool operator()(const ::std::shared_ptr<ObjectPrx>& lhs, const ::std::shared_ptr<ObjectPrx>& rhs) const
{
Expand Down Expand Up @@ -3147,9 +3118,6 @@ ICE_API bool proxyIdentityAndFacetEqual(const ObjectPrx& lhs, const ObjectPrx& r
* \headerfile Ice/Ice.h
*/
struct ProxyIdentityLess
#if (ICE_CPLUSPLUS < 201703L)
: std::binary_function<bool, ObjectPrx&, ObjectPrx&>
#endif
{
bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const
{
Expand All @@ -3163,9 +3131,6 @@ struct ProxyIdentityLess
* \headerfile Ice/Ice.h
*/
struct ProxyIdentityEqual
#if (ICE_CPLUSPLUS < 201703L)
: std::binary_function<bool, ObjectPrx&, ObjectPrx&>
#endif
{
bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const
{
Expand All @@ -3179,9 +3144,6 @@ struct ProxyIdentityEqual
* \headerfile Ice/Ice.h
*/
struct ProxyIdentityAndFacetLess
#if (ICE_CPLUSPLUS < 201703L)
: std::binary_function<bool, ObjectPrx&, ObjectPrx&>
#endif
{
bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const
{
Expand All @@ -3195,9 +3157,6 @@ struct ProxyIdentityAndFacetLess
* \headerfile Ice/Ice.h
*/
struct ProxyIdentityAndFacetEqual
#if (ICE_CPLUSPLUS < 201703L)
: std::binary_function<bool, ObjectPrx&, ObjectPrx&>
#endif
{
bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const
{
Expand Down
4 changes: 0 additions & 4 deletions cpp/include/IceUtil/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ class ICE_API Timer : public virtual IceUtil::Shared, private IceUtil::Thread
bool _destroyed;
std::set<Token> _tokens;

#if (ICE_CPLUSPLUS >= 201703L)
class TimerTaskCompare
#else
class TimerTaskCompare : public std::binary_function<TimerTaskPtr, TimerTaskPtr, bool>
#endif
{
public:

Expand Down