check_container.hpp
Go to the documentation of this file.
00001 /* 00002 Copyright 2005-2007 Adobe Systems Incorporated 00003 Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt 00004 or a copy at http://stlab.adobe.com/licenses.html) 00005 */ 00006 00007 /*************************************************************************************************/ 00008 00009 #include <adobe/config.hpp> 00010 00011 #include <adobe/check_container.hpp> 00012 00013 #include <boost/concept_check.hpp> 00014 00015 #include <adobe/test/check_regular.hpp> 00016 #include <adobe/implementation/swap.hpp> 00017 #include <iostream> 00018 00019 namespace adobe { 00026 template <typename T> 00027 void check_container(const T& c) 00028 { 00029 adobe::check_traversable(c); 00030 00031 // Containers add the requirement that each element visited once to traversable 00032 BOOST_CHECK_MESSAGE(c.size() == std::distance(c.begin(), c.end()), "container size"); 00033 BOOST_CHECK_MESSAGE(d.size() == std::distance(d.begin(), d.end()), "container size"); 00034 } 00035 00036 #if 0 00037 //gcc always instantiates this 00038 BOOST_TEST_CASE_TEMPLATE_FUNCTION(check_containers, T) 00039 { 00040 check_container(arbitrary_container_value<T>()); 00041 } 00042 #endif 00043 00045 } 00046 |