diff --git a/src/libraries/turtle/format.hpp b/src/libraries/turtle/format.hpp index cab7f8f..b2e0271 100644 --- a/src/libraries/turtle/format.hpp +++ b/src/libraries/turtle/format.hpp @@ -137,8 +137,8 @@ namespace detail s << '('; // if an error is generated by the line below it means T is // being mismatched for a container because it has a typedef - // const_iterator : the easiest solution would be to add a format - // function for Container as well. + // const_iterator : the solution would be to add a serialization + // operator for mock::formatter< T >. for( BOOST_DEDUCED_TYPENAME T::const_iterator it = f->begin(); it != f->end(); ++it ) { diff --git a/src/tests/turtle_test/format_test.cpp b/src/tests/turtle_test/format_test.cpp index 4507e72..391917c 100644 --- a/src/tests/turtle_test/format_test.cpp +++ b/src/tests/turtle_test/format_test.cpp @@ -196,3 +196,22 @@ BOOST_AUTO_TEST_CASE( boost_assign_map_list_of_are_serialized ) { BOOST_CHECK_EQUAL( "((12,\"12\"),(42,\"42\"))", to_string( boost::assign::map_list_of( 12, "12" )( 42, "42" ) ) ); } + +namespace +{ + struct false_positive_container + { + typedef int const_iterator; + }; + BOOST_MPL_ASSERT(( mock::detail::is_container< false_positive_container > )); + + std::ostream& operator<<( std::ostream& s, const mock::formatter< false_positive_container >& ) + { + return s << "false_positive_container"; + } +} + +BOOST_AUTO_TEST_CASE( false_positive_container_serialization_can_still_be_overriden ) +{ + BOOST_CHECK_EQUAL( "false_positive_container", to_string( false_positive_container() ) ); +}