Use <unordered_set> where available

This commit is contained in:
Daniel Pfeifer 2016-06-23 00:29:47 +02:00 committed by Brad King
parent ea5477e43d
commit 09aa2c9418
5 changed files with 18 additions and 2 deletions

View File

@ -33,4 +33,5 @@ endfunction()
if(CMAKE_CXX_STANDARD)
cm_check_cxx_feature(unordered_map)
cm_check_cxx_feature(unordered_set)
endif()

View File

@ -0,0 +1,7 @@
#include <unordered_set>
int main()
{
std::unordered_set<int> set;
set.insert(0);
return 0;
}

View File

@ -30,6 +30,7 @@
#cmakedefine CMAKE_USE_MACH_PARSER
#cmakedefine CMAKE_ENCODING_UTF8
#cmakedefine CMake_HAVE_CXX_UNORDERED_MAP
#cmakedefine CMake_HAVE_CXX_UNORDERED_SET
#define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
#define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"

View File

@ -27,7 +27,10 @@
#include "assert.h"
#include <errno.h>
#if defined(CMAKE_BUILD_WITH_CMAKE)
#if defined(CMake_HAVE_CXX_UNORDERED_SET)
#include <unordered_set>
#define UNORDERED_SET std::unordered_set
#elif defined(CMAKE_BUILD_WITH_CMAKE)
#include <cmsys/hash_set.hxx>
#define UNORDERED_SET cmsys::hash_set
#else

View File

@ -27,7 +27,11 @@
#include <map>
#include <set>
#include <stdlib.h> // required for atof
#if defined(CMAKE_BUILD_WITH_CMAKE)
#if defined(CMake_HAVE_CXX_UNORDERED_SET)
#include <unordered_set>
#define UNORDERED_SET std::unordered_set
#elif defined(CMAKE_BUILD_WITH_CMAKE)
#include <cmsys/hash_set.hxx>
#define UNORDERED_SET cmsys::hash_set
#else