stlab.adobe.com Adobe Systems Incorporated
check_regular.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 #include <boost/test/test_case_template.hpp>
11 #include <adobe/implementation/swap.hpp>
12 
13 namespace adobe {
19 template <typename T>
21 
22 
23 template <typename T>
24 void check_regular(const T& x)
25 {
26  using std::swap;
27 
28  BOOST_CHECK(x != T());
29  T y = x;
30  BOOST_CHECK_MESSAGE(x == y, "copy-ctor");
31  T z = T();
32  BOOST_CHECK_MESSAGE(z != x, "default-ctor");
33  z = y;
34  BOOST_CHECK_MESSAGE(x == z, "assignment");
35  T w = T();
36  swap(y, w);
37  BOOST_CHECK(x == w && x != y && y == T());
38 }
39 
40 
42 {
43  check_regular(arbitrary_regular_value<T>());
44 }
45 
46 }
47 
void swap(adobe::lex_stream_t &, adobe::lex_stream_t &)
Definition: lex_stream.hpp:68
void check_regular(const T &x)
T arbitrary_regular_value()
void swap(circular_queue< T > &, circular_queue< T > &)
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