Skip to content

Commit

Permalink
Replace std::unary_function<> with std::function<>
Browse files Browse the repository at this point in the history
(deprecated in C++11) and removed in C++17
  • Loading branch information
ClausKlein committed Aug 18, 2023
1 parent 694a7f3 commit bf556a0
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
9 changes: 7 additions & 2 deletions ACE/ace/Auto_Ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,14 @@ class ACE_Auto_Basic_Ptr

ACE_END_VERSIONED_NAMESPACE_DECL

// NOTE: ACE7 and TAO3 require C++11 support or newer; jwillemsen commented on Jun 1, 2021
#if defined (ACE_LACKS_AUTO_PTR)
# undef ACE_LACKS_AUTO_PTR
#endif

#if !defined (ACE_LACKS_AUTO_PTR)
#include <memory>
using std::auto_ptr;
# include <memory>
// NO! using std::unique_ptr;
#else /* !ACE_LACKS_AUTO_PTR */

ACE_BEGIN_VERSIONED_NAMESPACE_DECL
Expand Down
2 changes: 1 addition & 1 deletion ACE/tests/Reactor_Remove_Resume_Test_Dev_Poll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ dev_poll_reactor_factory ()
*
* Reactor test execution functor.
*/
struct Run_Test : public std::unary_function<reactor_factory_type, void>
struct Run_Test : public std::function<void(reactor_factory_type)>
{
/// Function call operator overload.
void operator() (reactor_factory_type factory)
Expand Down
2 changes: 1 addition & 1 deletion TAO/tests/Any/Recursive/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ directly_recursive_valuetype_typecodefactory_test (CORBA::ORB_ptr /* orb */,
* Test method invocation functor.
*/
template <typename T>
struct Caller : public std::unary_function<T, void>
struct Caller : public std::function<void(T)>
{
/// Constructor.
Caller (CORBA::ORB_ptr o, Test::Hello_ptr h)
Expand Down
2 changes: 1 addition & 1 deletion TAO/tests/Bug_2804_Regression/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ recursive_union_test (CORBA::ORB_ptr /* orb */,
* Test method invocation functor.
*/
template <typename T>
struct Caller : public std::unary_function<T, void>
struct Caller : public std::function<void(T)>
{
/// Constructor.
Caller (CORBA::ORB_ptr o, Test::Hello_ptr h)
Expand Down
2 changes: 1 addition & 1 deletion TAO/tests/Bug_2844_Regression/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ nested_recursive_struct_test (CORBA::ORB_ptr /* orb */,
* Test method invocation functor.
*/
template <typename T>
struct Caller : public std::unary_function<T, void>
struct Caller : public std::function<void(T)>
{
/// Constructor.
Caller (CORBA::ORB_ptr o, Test::Hello_ptr h)
Expand Down
2 changes: 1 addition & 1 deletion TAO/tests/Bug_2918_Regression/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ repeated_struct_test (CORBA::ORB_ptr /* orb */,
* Test method invocation functor.
*/
template <typename T>
struct Caller : public std::unary_function<T, void>
struct Caller : public std::function<void(T)>
{
/// Constructor.
Caller (CORBA::ORB_ptr o, Test::Hello_ptr h)
Expand Down
2 changes: 1 addition & 1 deletion TAO/tests/Bug_3919_Regression/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ nested_recursive_typecode_test (CORBA::ORB_ptr /* orb */,
* Test method invocation functor.
*/
template <typename T>
struct Caller : public std::unary_function<T, void>
struct Caller : public std::function<void(T)>
{
/// Constructor.
Caller (CORBA::ORB_ptr o, Test::Hello_ptr h)
Expand Down

0 comments on commit bf556a0

Please sign in to comment.