stlab.adobe.com Adobe Systems Incorporated
check_container.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 
7 /*************************************************************************************************/
8 
9 #include <adobe/config.hpp>
10 
11 #include <adobe/check_container.hpp>
12 
13 #include <boost/concept_check.hpp>
14 
16 #include <adobe/implementation/swap.hpp>
17 #include <iostream>
18 
19 namespace adobe {
26 template <typename T>
27 void check_container(const T& c)
28 {
30 
31 // Containers add the requirement that each element visited once to traversable
32  BOOST_CHECK_MESSAGE(c.size() == std::distance(c.begin(), c.end()), "container size");
33  BOOST_CHECK_MESSAGE(d.size() == std::distance(d.begin(), d.end()), "container size");
34 }
35 
36 #if 0
37 //gcc always instantiates this
38 BOOST_TEST_CASE_TEMPLATE_FUNCTION(check_containers, T)
39 {
40  check_container(arbitrary_container_value<T>());
41 }
42 #endif
43 
45 }
46 
boost::difference_type< I >::type distance(I &range)
Definition: distance.hpp:29
void check_traversable(const T &c)
void check_container(const T &c)
BOOST_TEST_CASE_TEMPLATE_FUNCTION(check_regulars, T)

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google