CppRedundantTypenameKeyword when using dependent types in function argument

template <bool same_thread = false>
class simplex_pipe_client_t {
    std::unordered_multimap<std::string, std::function<void(std::span<const uint8_t>)>> m_subscribers;

    <...snip...>

    template <size_t ssize>
    // ReSharper disable once CppRedundantTypenameKeyword
    void subscribe_topic(const char (&topic)[ssize], const typename decltype(m_subscribers)::value_type::second_type& callback) {
        m_subscribers.emplace(topic, callback);
    }
};

Without "typename" keyword the code won't compile, but ReSharper C++ suggests to remove it.
The code without "typename" keyword will compile if I get rid of "template <bool same_thread = false>" at the top.

1
2 comments

Hi! It looks more like an MSVC issue because the code will compile fine with GCC and Clang. 
Anyway, we'll think about workarounds, please upvote/follow the YouTrack ticket to get a notification when the issue is fixed:  https://youtrack.jetbrains.com/issue/RSCPP-32894.

0

Please sign in to leave a comment.