mirror of
https://github.com/boostorg/container_hash.git
synced 2025-08-02 22:14:34 +02:00
Add is_range_test3
This commit is contained in:
@@ -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 ;
|
||||
|
41
test/is_range_test3.cpp
Normal file
41
test/is_range_test3.cpp
Normal file
@@ -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 <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
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<class T> struct is_range;
|
||||
template<> struct is_range<X2>: boost::false_type {};
|
||||
|
||||
} // namespace container_hash
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/container_hash/is_range.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
using boost::container_hash::is_range;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((is_range<X1>));
|
||||
BOOST_TEST_TRAIT_FALSE((is_range<X2>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
Reference in New Issue
Block a user