Sign in to follow this  

deprecation, no breathing!

This topic is 4600 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Disturbed aside, from the aforementioned cross_map post, I am getting a whole slew of these errors: [Warning] `std::map<A, B, std::less<_Key>, std::allocator<std::pair<const _Key, _Tp> > >::iterator' is implicitly a... (cut off) [Warning] implicit typename is deprecated, please see the documentation for details For these functions, whose purpose should be fairly obvious.
    std::map< A, B >::iterator first_begin()
    {
        return first_map.begin();
    }
    std::map< B, A >::iterator second_begin()
    {
        return second_map.begin();
    }
    std::map< A, B >::iterator first_end()
    {
        return first_map.end();
    }
    std::map< B, A >::iterator second_end()
    {
        return second_map.end();
    }

Share this post


Link to post
Share on other sites
Change this to

typename std::map< A, B >::iterator first_begin()
{
return first_map.begin();
}
typename std::map< B, A >::iterator second_begin()
{
return second_map.begin();
}
typename std::map< A, B >::iterator first_end()
{
return first_map.end();
}
typename std::map< B, A >::iterator second_end()
{
return second_map.end();
}





and you'll be fine. The problem is that the compiler does not know if std::map< A, B>::iterator is a member typedef, member function, or member variable. Earlier, gcc would attempt to automatically determine which of those it is, now this doesn't happen. That's why you have to explicitly point out that std::map <A, B> is a typename.

For more information refer to agapow.net's article on implicit typename.

Share this post


Link to post
Share on other sites

This topic is 4600 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this