Jump to content
  • Advertisement
Sign in to follow this  
silverphyre673

deprecation, no breathing!

This topic is 4903 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!