mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Documented and tested container detection override
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@247 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
1c689400a0
commit
b61191a718
2 changed files with 21 additions and 2 deletions
|
|
@ -137,8 +137,8 @@ namespace detail
|
||||||
s << '(';
|
s << '(';
|
||||||
// if an error is generated by the line below it means T is
|
// if an error is generated by the line below it means T is
|
||||||
// being mismatched for a container because it has a typedef
|
// being mismatched for a container because it has a typedef
|
||||||
// const_iterator : the easiest solution would be to add a format
|
// const_iterator : the solution would be to add a serialization
|
||||||
// function for Container as well.
|
// operator for mock::formatter< T >.
|
||||||
for( BOOST_DEDUCED_TYPENAME T::const_iterator it = f->begin();
|
for( BOOST_DEDUCED_TYPENAME T::const_iterator it = f->begin();
|
||||||
it != f->end(); ++it )
|
it != f->end(); ++it )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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" ) ) );
|
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() ) );
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue