[unordered] patch to remove warning on Visual C++

Hi, appended is a small patch to fix some annoying warnings using Visual C++ 8.0 and 9.0. It would be nice if this could be looked at and applied to the trunk. The warnings were: 1>brick_pool.cpp 1>E:\devel\working_copies\schism_x64_vc90_sp1\externals\inc\boost\boost/unordered/unordered_map.hpp(388) : warning C4396: 'boost::operator ==' : the inline specifier cannot be used when a friend declaration refers to a specialization of a function template 1>E:\devel\working_copies\schism_x64_vc90_sp1\externals\inc\boost\boost/unordered/unordered_map.hpp(389) : warning C4396: 'boost::operator !=' : the inline specifier cannot be used when a friend declaration refers to a specialization of a function template Regards -chris -- Christopher Lux | | Bauhaus-Universität Weimar | faculty of media - virtual reality systems group

2008/11/14 Christopher Lux <christopherlux@gmail.com>:
Hi, appended is a small patch to fix some annoying warnings using Visual C++ 8.0 and 9.0.
It would be nice if this could be looked at and applied to the trunk.
I made a slightly different change that will hopefully fix the warnings. Although I'm not sure if it'll work on all compilers, so I might need to change it again once I've seen the regression tests. thanks, Daniel

Daniel James wrote:
appended is a small patch to fix some annoying warnings using Visual C++ 8.0 and 9.0.
It would be nice if this could be looked at and applied to the trunk.
I made a slightly different change that will hopefully fix the warnings. Although I'm not sure if it'll work on all compilers, so I might need to change it again once I've seen the regression tests.
Hi Daniel, thanks for the quick answer. But sadly your fix does not fix the warning at my system (VC 9.0 SP1 x64 and x86). Regards -chris -- Christopher Lux | | Bauhaus-Universität Weimar | faculty of media - virtual reality systems group

Daniel James wrote:
appended is a small patch to fix some annoying warnings using Visual C++ 8.0 and 9.0.
It would be nice if this could be looked at and applied to the trunk.
I made a slightly different change that will hopefully fix the warnings. Although I'm not sure if it'll work on all compilers, so I might need to change it again once I've seen the regression tests.
Hi Daniel, i think i found the source of the warnings. See the attached patch. Regards -chris -- Christopher Lux | | Bauhaus-Universität Weimar | faculty of media - virtual reality systems group Index: boost/unordered/unordered_map.hpp =================================================================== --- boost/unordered/unordered_map.hpp (revision 49734) +++ boost/unordered/unordered_map.hpp (working copy) @@ -391,14 +391,14 @@ }; // class template unordered_map template <class K, class T, class H, class P, class A> - inline bool operator==(unordered_map<K, T, H, P, A> const& m1, + bool operator==(unordered_map<K, T, H, P, A> const& m1, unordered_map<K, T, H, P, A> const& m2) { return boost::unordered_detail::equals(m1.base, m2.base); } template <class K, class T, class H, class P, class A> - inline bool operator!=(unordered_map<K, T, H, P, A> const& m1, + bool operator!=(unordered_map<K, T, H, P, A> const& m1, unordered_map<K, T, H, P, A> const& m2) { return !boost::unordered_detail::equals(m1.base, m2.base); Index: boost/unordered/unordered_set.hpp =================================================================== --- boost/unordered/unordered_set.hpp (revision 49734) +++ boost/unordered/unordered_set.hpp (working copy) @@ -363,14 +363,14 @@ }; // class template unordered_set template <class T, class H, class P, class A> - inline bool operator==(unordered_set<T, H, P, A> const& m1, + bool operator==(unordered_set<T, H, P, A> const& m1, unordered_set<T, H, P, A> const& m2) { return boost::unordered_detail::equals(m1.base, m2.base); } template <class T, class H, class P, class A> - inline bool operator!=(unordered_set<T, H, P, A> const& m1, + bool operator!=(unordered_set<T, H, P, A> const& m1, unordered_set<T, H, P, A> const& m2) { return !boost::unordered_detail::equals(m1.base, m2.base);

2008/11/16 Christopher Lux <christopherlux@gmail.com>:
i think i found the source of the warnings. See the attached patch.
Those functions are meant to be inline and I don't know of any good reason to change that. I suppressed the warnings with a pragma so they shouldn't appear any more. Daniel
participants (2)
-
Christopher Lux
-
Daniel James