#165 add explicit qualification in function calls

closed-fixed
7
2008-02-20
2008-01-24
No

Please consider the following code:

#include <boost/mpl/distance.hpp>
#include <boost/mpl/empty_base.hpp>
#include <list>
struct X : boost::mpl::empty_base {};
void dummy() {
std::list<X>().size();
}

This innocent code doesn't compile with STLPort - std::list::size() makes an unqualified call to distance(), so ADL finds both std::distance and boost::mpl::distance, resulting in anbiguity:

size_type size() const {
size_type __result = distance(begin(), end());
return __result;
}

Could you please change the call to qualified std::distance in this and similar places?

Thanks,
Maxim

Discussion

  • Francois Dumont

    Francois Dumont - 2008-01-24
    • priority: 5 --> 7
    • status: open --> open-accepted
     
  • Francois Dumont

    Francois Dumont - 2008-02-20
    • assigned_to: nobody --> dums
    • status: open-accepted --> closed-fixed
     
  • Francois Dumont

    Francois Dumont - 2008-02-20

    Logged In: YES
    user_id=1096600
    Originator: NO

    Many namespace qualification has been added to avoid the most obvious ADL issues.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks