From 20c03417b03f42263ad6523e3d41bac7b5861d2f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 18 Sep 2022 14:04:05 +0300 Subject: [PATCH] Add is_range_test3 --- test/Jamfile.v2 | 2 ++ test/is_range_test3.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 test/is_range_test3.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index c2daf95..814200a 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -97,3 +97,5 @@ run hash_unordered_multimap_test.cpp ; run hash_unordered_set_test.cpp ; run hash_unordered_map_test.cpp ; + +run is_range_test3.cpp ; diff --git a/test/is_range_test3.cpp b/test/is_range_test3.cpp new file mode 100644 index 0000000..58b2d34 --- /dev/null +++ b/test/is_range_test3.cpp @@ -0,0 +1,41 @@ +// Copyright 2022 Peter Dimov. +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include + +struct X1 +{ + char const* begin() const; + char const* end() const; +}; + +struct X2 +{ + char const* begin() const; + char const* end() const; +}; + +namespace boost +{ +namespace container_hash +{ + +template struct is_range; +template<> struct is_range: boost::false_type {}; + +} // namespace container_hash +} // namespace boost + +#include +#include + +int main() +{ + using boost::container_hash::is_range; + + BOOST_TEST_TRAIT_TRUE((is_range)); + BOOST_TEST_TRAIT_FALSE((is_range)); + + return boost::report_errors(); +}