mirror of
https://github.com/boostorg/config.git
synced 2025-07-30 04:17:16 +02:00
Fix C++0x helper macros
[SVN r37178]
This commit is contained in:
22
config.htm
22
config.htm
@ -1135,7 +1135,7 @@ void g() { return f(); }</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="50%">BOOST_CXX0X_CONCEPTS</td>
|
||||
<td valign="top" width="50%">BOOST_HAS_CONCEPTS</td>
|
||||
<td valign="top" width="50%">
|
||||
The compiler supports <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2081.pdf">
|
||||
concepts</a>. <b>Note</b>: concepts have been proposed for C++0x, but have
|
||||
@ -1143,35 +1143,21 @@ void g() { return f(); }</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="50%">BOOST_CXX0X_LONG_LONG</td>
|
||||
<td valign="top" width="50%">
|
||||
The compiler supports the long long. Identical to <tt>BOOST_HAS_LONG_LONG</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="50%">BOOST_CXX0X_PREPROCESSOR</td>
|
||||
<td valign="top" width="50%">
|
||||
The compiler supports the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm">
|
||||
C99 preprocessor</a>, which includes variadic macros, concatenation of wide
|
||||
string literals, and the <code>_Pragma</code> operator.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="50%">BOOST_CXX0X_RVALUE_REFERENCES</td>
|
||||
<td valign="top" width="50%">BOOST_HAS_RVALUE_REFS</td>
|
||||
<td valign="top" width="50%">
|
||||
The compiler supports <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html">
|
||||
rvalue references</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="50%">BOOST_CXX0X_STATIC_ASSERT</td>
|
||||
<td valign="top" width="50%">BOOST_HAS_STATIC_ASSERT</td>
|
||||
<td valign="top" width="50%">
|
||||
The compiler supports <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html">
|
||||
static assertions</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="50%">BOOST_CXX0X_VARIADIC_TEMPLATES</td>
|
||||
<td valign="top" width="50%">BOOST_HAS_VARIADIC_TMPL</td>
|
||||
<td valign="top" width="50%">
|
||||
The compiler supports <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2080.pdf">
|
||||
variadic templates</a>. <b>Note</b>: variadic templates have been proposed
|
||||
|
@ -92,8 +92,10 @@
|
||||
// defined by some very early development versions of GCC 4.3; we will
|
||||
// remove this part of the check in the near future.
|
||||
# if defined(__GXX_EXPERIMENTAL_CPP0X__) || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
# define BOOST_CXX0X_PREPROCESSOR
|
||||
# define BOOST_CXX0X_STATIC_ASSERT
|
||||
# define BOOST_HAS_STATIC_ASSERT
|
||||
# ifndef __STRICT_ANSI__
|
||||
# define BOOST_HAS_VARIADIC_TMPL
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -104,13 +106,13 @@
|
||||
// Variadic templates compiler:
|
||||
// http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html
|
||||
#ifdef __VARIADIC_TEMPLATES
|
||||
# define BOOST_CXX0X_VARIADIC_TEMPLATES
|
||||
# define BOOST_HAS_VARIADIC_TMPL
|
||||
#endif
|
||||
|
||||
// ConceptGCC compiler:
|
||||
// http://www.generic-programming.org/software/ConceptGCC/
|
||||
#ifdef __GXX_CONCEPTS__
|
||||
# define BOOST_CXX0X_CONCEPTS
|
||||
# define BOOST_HAS_CONCEPTS
|
||||
# define BOOST_COMPILER "ConceptGCC version " __VERSION__
|
||||
#endif
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
||||
// C++0x features
|
||||
//
|
||||
#if __option(rvalue_refs)
|
||||
# define BOOST_CXX0X_RVALUE_REFERENCES
|
||||
# define BOOST_HAS_RVALUE_REFS
|
||||
#endif
|
||||
|
||||
#define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
|
||||
|
@ -38,16 +38,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// BOOST_HAS_LONG_LONG implies BOOST_CXX0X_LONG_LONG, and vice-versa
|
||||
#if defined(BOOST_HAS_LONG_LONG) || defined(BOOST_CXX0X_LONG_LONG)
|
||||
# ifndef BOOST_HAS_LONG_LONG
|
||||
# define BOOST_HAS_LONG_LONG
|
||||
# endif
|
||||
# ifndef BOOST_CXX0X_LONG_LONG
|
||||
# define BOOST_CXX0X_LONG_LONG
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// GCC 3.x will clean up all of those nasty macro definitions that
|
||||
// BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine
|
||||
// it under GCC 3.x.
|
||||
@ -55,7 +45,6 @@
|
||||
# undef BOOST_NO_CTYPE_FUNCTIONS
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Assume any extensions are in namespace std:: unless stated otherwise:
|
||||
//
|
||||
|
23
test/boost_has_concepts.ipp
Normal file
23
test/boost_has_concepts.ipp
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright (C) 2007 Douglas Gregor
|
||||
// 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_HAS_CONCEPTS
|
||||
// TITLE: concepts
|
||||
// DESCRIPTION: The compiler supports C++0x concepts
|
||||
|
||||
namespace boost_has_concepts {
|
||||
|
||||
concept C<typename T> { }
|
||||
|
||||
concept_map C<int> { }
|
||||
|
||||
int test()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
26
test/boost_has_rvalue_refs.ipp
Normal file
26
test/boost_has_rvalue_refs.ipp
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright (C) 2007 Douglas Gregor
|
||||
// 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_HAS_RVALUE_REFS
|
||||
// TITLE: rvalue references
|
||||
// DESCRIPTION: The compiler supports C++0x rvalue references
|
||||
|
||||
namespace boost_has_rvalue_refs {
|
||||
|
||||
void g(int&) {}
|
||||
|
||||
template<typename F, typename T>
|
||||
void forward(F f, T&& t) { f(static_cast<T&&>(t)); }
|
||||
|
||||
int test()
|
||||
{
|
||||
int x;
|
||||
forward(g, x);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
20
test/boost_has_static_assert.ipp
Normal file
20
test/boost_has_static_assert.ipp
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2007 Douglas Gregor
|
||||
// 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_HAS_STATIC_ASSERT
|
||||
// TITLE: static assertions
|
||||
// DESCRIPTION: The compiler supports C++0x static assertions
|
||||
|
||||
namespace boost_has_static_assert {
|
||||
|
||||
int test()
|
||||
{
|
||||
static_assert(true, "OK");
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
21
test/boost_has_variadic_tmpl.ipp
Normal file
21
test/boost_has_variadic_tmpl.ipp
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright (C) 2007 Douglas Gregor
|
||||
// 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_HAS_VARIADIC_TMPL
|
||||
// TITLE: variadic templates
|
||||
// DESCRIPTION: The compiler supports C++0x variadic templates
|
||||
|
||||
namespace boost_has_variadic_tmpl {
|
||||
|
||||
template<typename... Elements> struct tuple {};
|
||||
|
||||
int test()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user