forked from boostorg/config
Add BOOST_NULLPTR helper macro
This commit is contained in:
@ -966,6 +966,10 @@ and must be defined for all translation units in the program, including Boost li
|
||||
This macro will no longer have any effect once an official Microsoft
|
||||
release supports the CTP features.
|
||||
]]
|
||||
[[`BOOST_NULLPTR`][
|
||||
If `BOOST_NO_CXX11_NULLPTR` is not defined (i.e. C++11 compliant compilers), expands to `nullptr`,
|
||||
otherwise expands to `0`.
|
||||
]]
|
||||
]
|
||||
|
||||
[endsect]
|
||||
|
@ -1069,6 +1069,12 @@ namespace std{ using ::type_info; }
|
||||
|
||||
#define BOOST_STATIC_CONSTEXPR static BOOST_CONSTEXPR_OR_CONST
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_NULLPTR)
|
||||
# define BOOST_NULLPTR nullptr
|
||||
#else
|
||||
# define BOOST_NULLPTR 0
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set BOOST_HAS_STATIC_ASSERT when BOOST_NO_CXX11_STATIC_ASSERT is not defined
|
||||
//
|
||||
|
@ -62,6 +62,10 @@ struct trait
|
||||
enum { value = b };
|
||||
};
|
||||
|
||||
void* test_nullptr()
|
||||
{
|
||||
return BOOST_NULLPTR;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
@ -82,6 +86,8 @@ int main()
|
||||
{
|
||||
result += 2;
|
||||
}
|
||||
|
||||
test_nullptr();
|
||||
}
|
||||
catch(int)
|
||||
{
|
||||
|
Reference in New Issue
Block a user