From 8fda9113b8f568c32790f49559268c00509350fd Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 18 Sep 2016 12:22:48 +0100 Subject: [PATCH] Make 'has_unique_keys' container independent. --- test/helpers/metafunctions.hpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/test/helpers/metafunctions.hpp b/test/helpers/metafunctions.hpp index 139fe0a2..8e36549d 100644 --- a/test/helpers/metafunctions.hpp +++ b/test/helpers/metafunctions.hpp @@ -8,8 +8,6 @@ #include #include -#include -#include namespace test { @@ -22,19 +20,11 @@ namespace test template struct has_unique_keys { - BOOST_STATIC_CONSTANT(bool, value = false); - }; - - template - struct has_unique_keys > - { - BOOST_STATIC_CONSTANT(bool, value = true); - }; - - template - struct has_unique_keys > - { - BOOST_STATIC_CONSTANT(bool, value = true); + static char flip(BOOST_DEDUCED_TYPENAME Container::iterator const&); + static long flip(std::pair const&); + BOOST_STATIC_CONSTANT(bool, value = sizeof(long) == sizeof( + flip(((Container*) 0)->insert(*(BOOST_DEDUCED_TYPENAME Container::value_type*) 0)) + )); }; }