Boost logo

Boost :

Subject: Re: [boost] [smart_ptr] error with nullptr_t
From: Peter Dimov (lists_at_[hidden])
Date: 2012-12-19 06:00:06


Eric Niebler wrote:

> I just got bit by this. For the record, I don't think it's
> Boost.Config's business to be defining std::move, std::forward, etc.

It's not like this is a first.

// BOOST_NO_STDC_NAMESPACE
orkaround --------------------------------------//
// Because std::size_t usage is so common, even in boost headers which do
not
// otherwise use the C library, the <cstddef> workaround is included here
so
// that ugly workaround code need not appear in many other boost headers.
// NOTE WELL: This is a workaround for non-conforming compilers; <cstddef>
// must still be #included in the usual places so that <cstddef> inclusion
// works as expected with standard conforming compilers. The resulting
// double inclusion of <cstddef> is harmless.

# if defined(BOOST_NO_STDC_NAMESPACE) && defined(__cplusplus)
# include <cstddef>
    namespace std { using ::ptrdiff_t; using ::size_t; }
# endif

and

// BOOST_NO_STD_MIN_MAX
orkaround -----------------------------------------//

# if defined(BOOST_NO_STD_MIN_MAX) && defined(__cplusplus)

namespace std {
  template <class _Tp>
  inline const _Tp& min BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a,
const _Tp& __b) {
    return __b < __a ? __b : __a;
  }
  template <class _Tp>
  inline const _Tp& max BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a,
const _Tp& __b) {
    return __a < __b ? __b : __a;
  }
}

# endif

and

// When BOOST_NO_STD_TYPEINFO is defined, we can just import
// the global definition into std namespace:
#if defined(BOOST_NO_STD_TYPEINFO) && defined(__cplusplus)
#include <typeinfo>
namespace std{ using ::type_info; }
#endif


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk