forked from boostorg/config
Added BOOST_NO_STD_UNORDERED config macro.
[SVN r50362]
This commit is contained in:
1 parent
d0b83d60af
commit
167b63bd33
22 files changed
+195
-17
No files matched your search
+4
-1
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Regression test Jamfile for boost configuration setup.
|
||||
# *** DO NOT EDIT THIS FILE BY HAND ***
|
||||
# This file was automatically generated on Wed Sep 24 11:44:22 2008
|
||||
# This file was automatically generated on Tue Dec 16 16:41:41 2008
|
||||
# by libs/config/tools/generate.cpp
|
||||
# Copyright John Maddock.
|
||||
# Use, modification and distribution are subject to the
|
||||
@@ -337,6 +337,9 @@ test-suite "BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN" :
|
||||
test-suite "BOOST_NO_STD_TYPEINFO" :
|
||||
[ run ../no_std_typeinfo_pass.cpp ]
|
||||
[ compile-fail ../no_std_typeinfo_fail.cpp ] ;
|
||||
test-suite "BOOST_NO_STD_UNORDERED" :
|
||||
[ run ../no_std_unordered_pass.cpp ]
|
||||
[ compile-fail ../no_std_unordered_fail.cpp ] ;
|
||||
test-suite "BOOST_NO_STD_USE_FACET" :
|
||||
[ run ../no_std_use_facet_pass.cpp ]
|
||||
[ compile-fail ../no_std_use_facet_fail.cpp ] ;
|
||||
|
||||
+17
-3
@@ -11,9 +11,17 @@
|
||||
// or hash_map classes.
|
||||
|
||||
#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
|
||||
# define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
|
||||
#include <ext/hash_set>
|
||||
#include <ext/hash_map>
|
||||
# ifdef BOOST_NO_STD_UNORDERED
|
||||
# define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
|
||||
# include <ext/hash_set>
|
||||
# include <ext/hash_map>
|
||||
# else
|
||||
// If we have BOOST_NO_STD_UNORDERED *not* defined, then we must
|
||||
// not include the <ext/*> headers as they clash with the C++0x
|
||||
// headers. ie in any given translation unit we can include one
|
||||
// or the other, but not both.
|
||||
# define DISABLE_BOOST_HAS_HASH_TEST
|
||||
# endif
|
||||
#else
|
||||
#include <hash_set>
|
||||
#include <hash_map>
|
||||
@@ -25,6 +33,8 @@
|
||||
|
||||
namespace boost_has_hash{
|
||||
|
||||
#ifndef DISABLE_BOOST_HAS_HASH_TEST
|
||||
|
||||
template <class Key, class Eq, class Hash, class Alloc>
|
||||
void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_set<Key,Eq,Hash,Alloc>& )
|
||||
{
|
||||
@@ -35,12 +45,16 @@ void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_map<Key,T,Eq,Hash,Alloc>& )
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int test()
|
||||
{
|
||||
#ifndef DISABLE_BOOST_HAS_HASH_TEST
|
||||
BOOST_STD_EXTENSION_NAMESPACE::hash_set<int> hs;
|
||||
foo(hs);
|
||||
BOOST_STD_EXTENSION_NAMESPACE::hash_map<int, long> hm;
|
||||
foo(hm);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// (C) Copyright John Maddock and Dave Abrahams 2002.
|
||||
// Use, modification and distribution are subject to 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)
|
||||
|
||||
// See http://www.boost.org/libs/config for most recent version.
|
||||
|
||||
// MACRO: BOOST_NO_STD_UNORDERED
|
||||
// TITLE: <unordered_map> and <unordered_set>
|
||||
// DESCRIPTION: Check for C++0x unordered container support
|
||||
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace boost_no_std_unordered{
|
||||
|
||||
int test()
|
||||
{
|
||||
std::unordered_map<int, int> im;
|
||||
std::unordered_set<int> is;
|
||||
std::unordered_multimap<int, int> imm;
|
||||
std::unordered_multiset<int> ims;
|
||||
return im.size() + is.size() + imm.size() + ims.size(); // all zero
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1001,6 +1001,7 @@ void print_boost_macros()
|
||||
PRINT_MACRO(BOOST_NO_STD_MIN_MAX);
|
||||
PRINT_MACRO(BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN);
|
||||
PRINT_MACRO(BOOST_NO_STD_TYPEINFO);
|
||||
PRINT_MACRO(BOOST_NO_STD_UNORDERED);
|
||||
PRINT_MACRO(BOOST_NO_STD_USE_FACET);
|
||||
PRINT_MACRO(BOOST_NO_STD_WSTREAMBUF);
|
||||
PRINT_MACRO(BOOST_NO_STD_WSTRING);
|
||||
@@ -1041,6 +1042,7 @@ void print_boost_macros()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// END GENERATED BLOCK
|
||||
|
||||
+11
-1
@@ -1,4 +1,4 @@
|
||||
// This file was automatically generated on Wed Sep 24 11:44:22 2008
|
||||
// This file was automatically generated on Tue Dec 16 16:41:41 2008
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are subject to the
|
||||
@@ -292,6 +292,11 @@ namespace boost_no_std_output_iterator_assign = empty_boost;
|
||||
#else
|
||||
namespace boost_no_std_typeinfo = empty_boost;
|
||||
#endif
|
||||
#ifndef BOOST_NO_STD_UNORDERED
|
||||
#include "boost_no_std_unordered.ipp"
|
||||
#else
|
||||
namespace boost_no_std_unordered = empty_boost;
|
||||
#endif
|
||||
#ifndef BOOST_NO_STD_USE_FACET
|
||||
#include "boost_no_std_use_facet.ipp"
|
||||
#else
|
||||
@@ -1146,6 +1151,11 @@ int main( int, char *[] )
|
||||
std::cerr << "Failed test for BOOST_NO_STD_TYPEINFO at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
++error_count;
|
||||
}
|
||||
if(0 != boost_no_std_unordered::test())
|
||||
{
|
||||
std::cerr << "Failed test for BOOST_NO_STD_UNORDERED at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
++error_count;
|
||||
}
|
||||
if(0 != boost_no_std_use_facet::test())
|
||||
{
|
||||
std::cerr << "Failed test for BOOST_NO_STD_USE_FACET at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Tue Dec 16 16:41:40 2008
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are subject to 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)
|
||||
|
||||
// See http://www.boost.org/libs/config for the most recent version.//
|
||||
// Revision $Id: generate.cpp 49281 2008-10-11 15:40:44Z johnmaddock $
|
||||
//
|
||||
|
||||
|
||||
// Test file for macro BOOST_NO_STD_UNORDERED
|
||||
// This file should not compile, if it does then
|
||||
// BOOST_NO_STD_UNORDERED should not be defined.
|
||||
// See file boost_no_std_unordered.ipp for details
|
||||
|
||||
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
||||
// the objective of this file:
|
||||
#ifdef BOOST_ASSERT_CONFIG
|
||||
# undef BOOST_ASSERT_CONFIG
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_NO_STD_UNORDERED
|
||||
#include "boost_no_std_unordered.ipp"
|
||||
#else
|
||||
#error "this file should not compile"
|
||||
#endif
|
||||
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return boost_no_std_unordered::test();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Tue Dec 16 16:41:40 2008
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are subject to 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)
|
||||
|
||||
// See http://www.boost.org/libs/config for the most recent version.//
|
||||
// Revision $Id: generate.cpp 49281 2008-10-11 15:40:44Z johnmaddock $
|
||||
//
|
||||
|
||||
|
||||
// Test file for macro BOOST_NO_STD_UNORDERED
|
||||
// This file should compile, if it does not then
|
||||
// BOOST_NO_STD_UNORDERED should be defined.
|
||||
// See file boost_no_std_unordered.ipp for details
|
||||
|
||||
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
||||
// the objective of this file:
|
||||
#ifdef BOOST_ASSERT_CONFIG
|
||||
# undef BOOST_ASSERT_CONFIG
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include "test.hpp"
|
||||
|
||||
#ifndef BOOST_NO_STD_UNORDERED
|
||||
#include "boost_no_std_unordered.ipp"
|
||||
#else
|
||||
namespace boost_no_std_unordered = empty_boost;
|
||||
#endif
|
||||
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return boost_no_std_unordered::test();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user