Skip to content

std::result_of is deprecated #19

Closed
@kjellahl

Description

@kjellahl

According to https://en.cppreference.com/w/cpp/types/result_of std::result_of<> is
deprecated in C++17 and will be removed in C++20. It's used in sigc++/tuple-utils/tuple_transform_each.h.
It looks like it's replaced by std::invoke_result<>.

I tried to replace result_of by invoke_result in tuple_transform_each.h, but it's
not as easy as that. make check resulted in several compile-time errors.
The first error is

/home/kjell/checkout/gnome/libsigcplusplus/sigc++/tuple-utils/tuple_transform_each.h:49:81: error: no type named ‘type’ in ‘struct std::invoke_result<int& (*(sigc::bound_argument<int>&))(sigc::bound_argument<int>&)>’
         &T_transformer<from_element_type>::transform)(from_element_type&)>::type;
                                                                                 ^
/home/kjell/checkout/gnome/libsigcplusplus/sigc++/tuple-utils/tuple_transform_each.h:51:14: error: no type named ‘type’ in ‘struct std::invoke_result<int& (*(sigc::bound_argument<int>&))(sigc::bound_argument<int>&)>’
         std::tuple<to_element_type>(T_transformer<from_element_type>::transform(std::get<index>(t_original)));
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions