1 | // (C) Copyright Gennadiy Rozental 2001. |
2 | // Distributed under the Boost Software License, Version 1.0. |
3 | // (See accompanying file LICENSE_1_0.txt or copy at |
4 | // http://www.boost.org/LICENSE_1_0.txt) |
5 | |
6 | // See http://www.boost.org/libs/test for the library home page. |
7 | // |
8 | //!@file |
9 | //!@brief contains mics. workarounds |
10 | // *************************************************************************** |
11 | |
12 | #ifndef BOOST_TEST_WORKAROUND_HPP_021005GER |
13 | #define BOOST_TEST_WORKAROUND_HPP_021005GER |
14 | |
15 | // Boost |
16 | #include <boost/config.hpp> // compilers workarounds and std::ptrdiff_t |
17 | |
18 | // STL |
19 | #include <iterator> // for std::distance |
20 | |
21 | #include <boost/test/detail/suppress_warnings.hpp> |
22 | |
23 | //____________________________________________________________________________// |
24 | |
25 | namespace boost { |
26 | namespace unit_test { |
27 | namespace ut_detail { |
28 | |
29 | #ifdef BOOST_NO_STD_DISTANCE |
30 | template <class T> |
31 | std::ptrdiff_t distance( T const& x_, T const& y_ ) |
32 | { |
33 | std::ptrdiff_t res = 0; |
34 | |
35 | std::distance( x_, y_, res ); |
36 | |
37 | return res; |
38 | } |
39 | |
40 | //____________________________________________________________________________// |
41 | |
42 | #else |
43 | using std::distance; |
44 | #endif |
45 | |
46 | template <class T> inline void ignore_unused_variable_warning(const T&) {} |
47 | |
48 | } // namespace ut_detail |
49 | } // namespace unit_test |
50 | } // namespace boost |
51 | |
52 | //____________________________________________________________________________// |
53 | |
54 | #include <boost/test/detail/enable_warnings.hpp> |
55 | |
56 | #endif // BOOST_TEST_WORKAROUND_HPP_021005GER |
57 | |