mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-24 01:27:37 +02:00
Fixed ambiguous call of hash_value
ADL also picks stdext::hash_value which msvc providing.
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
Copyright (c) 2014 Christoph Weiss
|
Copyright (c) 2014 Christoph Weiss
|
||||||
|
Copyright (c) 2017 Kohei Takahashi
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@ -11,24 +12,24 @@
|
|||||||
#include <boost/fusion/sequence/hash.hpp>
|
#include <boost/fusion/sequence/hash.hpp>
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/functional/hash.hpp>
|
||||||
|
|
||||||
void
|
void hash_test()
|
||||||
hash_test()
|
|
||||||
{
|
{
|
||||||
using namespace boost::fusion;
|
namespace fusion = boost::fusion;
|
||||||
|
using namespace fusion;
|
||||||
|
|
||||||
const FUSION_SEQUENCE<int, char, bool, std::string> v0(42, 'x', false, "Aurea prima");
|
const FUSION_SEQUENCE<int, char, bool, std::string> v0(42, 'x', false, "Aurea prima");
|
||||||
const FUSION_SEQUENCE<int, char, bool, std::string> v1(42, 'x', false, "Aurea prima");
|
const FUSION_SEQUENCE<int, char, bool, std::string> v1(42, 'x', false, "Aurea prima");
|
||||||
BOOST_TEST(hash_value(v0) == hash_value(v1));
|
BOOST_TEST(fusion::hash_value(v0) == fusion::hash_value(v1));
|
||||||
|
|
||||||
const FUSION_SEQUENCE<int, char, bool, std::string> w(41, 'x', false, "Aurea prima");
|
const FUSION_SEQUENCE<int, char, bool, std::string> w(41, 'x', false, "Aurea prima");
|
||||||
BOOST_TEST(hash_value(w) != hash_value(v0));
|
BOOST_TEST(fusion::hash_value(w) != fusion::hash_value(v0));
|
||||||
|
|
||||||
const FUSION_SEQUENCE<int, char, bool, std::string> x(42, 'y', false, "Aurea prima");
|
const FUSION_SEQUENCE<int, char, bool, std::string> x(42, 'y', false, "Aurea prima");
|
||||||
BOOST_TEST(hash_value(x) != hash_value(v0));
|
BOOST_TEST(fusion::hash_value(x) != fusion::hash_value(v0));
|
||||||
|
|
||||||
const FUSION_SEQUENCE<int, char, bool, std::string> y(42, 'x', true, "Aurea prima");
|
const FUSION_SEQUENCE<int, char, bool, std::string> y(42, 'x', true, "Aurea prima");
|
||||||
BOOST_TEST(hash_value(y) != hash_value(v0));
|
BOOST_TEST(fusion::hash_value(y) != fusion::hash_value(v0));
|
||||||
|
|
||||||
const FUSION_SEQUENCE<int, char, bool, std::string> z(42, 'x', false, "quae vindice nullo");
|
const FUSION_SEQUENCE<int, char, bool, std::string> z(42, 'x', false, "quae vindice nullo");
|
||||||
BOOST_TEST(hash_value(z) != hash_value(v0));
|
BOOST_TEST(fusion::hash_value(z) != fusion::hash_value(v0));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user