From 966c41595370d0250613b5cece4001a0a6224329 Mon Sep 17 00:00:00 2001 From: mat007 Date: Fri, 13 Apr 2012 14:55:38 +0000 Subject: [PATCH] Refactoring to prevent ADL to pick up operator== for map iterators with certain compilers git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@442 860be788-9bd5-4423-9f1e-828f051e677b --- src/libraries/turtle/context.hpp | 4 ++-- src/libraries/turtle/function.hpp | 2 +- src/libraries/turtle/object.hpp | 12 ++++++------ src/libraries/turtle/verifiable.hpp | 3 +++ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/libraries/turtle/context.hpp b/src/libraries/turtle/context.hpp index 803d896..30b95c0 100644 --- a/src/libraries/turtle/context.hpp +++ b/src/libraries/turtle/context.hpp @@ -18,10 +18,10 @@ namespace mock { - class verifiable; - namespace detail { + class verifiable; + class context : boost::noncopyable { public: diff --git a/src/libraries/turtle/function.hpp b/src/libraries/turtle/function.hpp index df33301..607f26c 100644 --- a/src/libraries/turtle/function.hpp +++ b/src/libraries/turtle/function.hpp @@ -139,7 +139,7 @@ namespace mock } private: - class function_impl : public verifiable + class function_impl : public detail::verifiable { public: typedef MOCK_ERROR_POLICY< result_type > error_type; diff --git a/src/libraries/turtle/object.hpp b/src/libraries/turtle/object.hpp index 5b0c05f..8c8abf4 100644 --- a/src/libraries/turtle/object.hpp +++ b/src/libraries/turtle/object.hpp @@ -33,10 +33,10 @@ namespace mock {} private: - class object_impl : public detail::context, private verifiable + class object_impl : public detail::context, private detail::verifiable { public: - virtual void add( const void* /*p*/, verifiable& v, + virtual void add( const void* /*p*/, detail::verifiable& v, boost::unit_test::const_string instance, const boost::optional< detail::type_name >& type, boost::unit_test::const_string name ) @@ -45,11 +45,11 @@ namespace mock mock::detail::root.add( *this ); children_[ &v ].update( parent_, instance, type, name ); } - virtual void add( verifiable& v ) + virtual void add( detail::verifiable& v ) { group_.add( v ); } - virtual void remove( verifiable& v ) + virtual void remove( detail::verifiable& v ) { group_.remove( v ); children_.erase( &v ); @@ -58,7 +58,7 @@ namespace mock } virtual void serialize( std::ostream& s, - const verifiable& v ) const + const detail::verifiable& v ) const { children_cit it = children_.find( &v ); if( it != children_.end() ) @@ -77,7 +77,7 @@ namespace mock } private: - typedef std::map< const verifiable*, detail::child > children_t; + typedef std::map< const detail::verifiable*, detail::child > children_t; typedef children_t::const_iterator children_cit; detail::group group_; diff --git a/src/libraries/turtle/verifiable.hpp b/src/libraries/turtle/verifiable.hpp index 2fa4c6b..19d8c59 100644 --- a/src/libraries/turtle/verifiable.hpp +++ b/src/libraries/turtle/verifiable.hpp @@ -13,6 +13,8 @@ #include namespace mock +{ +namespace detail { class verifiable : private boost::noncopyable { @@ -25,5 +27,6 @@ namespace mock virtual void reset() = 0; }; } +} #endif // MOCK_VERIFIABLE_HPP_INCLUDED