Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 1 | // (C) Copyright Gennadiy Rozental 2005-2008. |
| 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 : $RCSfile$ |
| 9 | // |
| 10 | // Version : $Revision: 54633 $ |
| 11 | // |
| 12 | // Description : contains mics. workarounds |
| 13 | // *************************************************************************** |
| 14 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 15 | #ifndef NDNBOOST_TEST_WORKAROUND_HPP_021005GER |
| 16 | #define NDNBOOST_TEST_WORKAROUND_HPP_021005GER |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 17 | |
| 18 | // Boost |
| 19 | #include <ndnboost/config.hpp> // compilers workarounds and std::ptrdiff_t |
| 20 | |
| 21 | // STL |
| 22 | #include <iterator> // for std::distance |
| 23 | |
| 24 | #include <ndnboost/test/detail/suppress_warnings.hpp> |
| 25 | |
| 26 | //____________________________________________________________________________// |
| 27 | |
| 28 | namespace ndnboost { |
| 29 | |
| 30 | namespace unit_test { |
| 31 | |
| 32 | namespace ut_detail { |
| 33 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 34 | #ifdef NDNBOOST_NO_STD_DISTANCE |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 35 | template <class T> |
| 36 | std::ptrdiff_t distance( T const& x_, T const& y_ ) |
| 37 | { |
| 38 | std::ptrdiff_t res = 0; |
| 39 | |
| 40 | std::distance( x_, y_, res ); |
| 41 | |
| 42 | return res; |
| 43 | } |
| 44 | |
| 45 | //____________________________________________________________________________// |
| 46 | |
| 47 | #else |
| 48 | using std::distance; |
| 49 | #endif |
| 50 | |
| 51 | template <class T> inline void ignore_unused_variable_warning(const T&) {} |
| 52 | |
| 53 | } // namespace ut_detail |
| 54 | |
| 55 | } // namespace unit_test |
| 56 | |
| 57 | namespace unit_test_framework = unit_test; |
| 58 | |
| 59 | } // namespace ndnboost |
| 60 | |
| 61 | //____________________________________________________________________________// |
| 62 | |
| 63 | #include <ndnboost/test/detail/enable_warnings.hpp> |
| 64 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 65 | #endif // NDNBOOST_TEST_WORKAROUND_HPP_021005GER |