IterVal,
boost::forward_traversal_tag>
{
- explicit aha_iterator() : aha_(0) {}
+ explicit aha_iterator() : aha_(nullptr) {}
// Conversion ctor for interoperability between const_iterator and
// iterator. The enable_if<> magic keeps us well-behaved for
// is_convertible<> (v. the iterator_facade documentation).
template <class OtherContT, class OtherVal>
- aha_iterator(const aha_iterator<OtherContT,OtherVal>& o,
- typename std::enable_if<
- std::is_convertible<OtherVal*,IterVal*>::value >::type* = 0)
- : aha_(o.aha_)
- , offset_(o.offset_)
- {}
+ aha_iterator(
+ const aha_iterator<OtherContT, OtherVal>& o,
+ typename std::enable_if<
+ std::is_convertible<OtherVal*, IterVal*>::value>::type* = nullptr)
+ : aha_(o.aha_), offset_(o.offset_) {}
explicit aha_iterator(ContT* array, size_t offset)
: aha_(array)
ahm_iterator : boost::iterator_facade<ahm_iterator<ContT, IterVal, SubIt>,
IterVal,
boost::forward_traversal_tag> {
- explicit ahm_iterator() : ahm_(0) {}
+ explicit ahm_iterator() : ahm_(nullptr) {}
// Conversion ctor for interoperability between const_iterator and
// iterator. The enable_if<> magic keeps us well-behaved for
// is_convertible<> (v. the iterator_facade documentation).
template <class OtherContT, class OtherVal, class OtherSubIt>
- ahm_iterator(const ahm_iterator<OtherContT,OtherVal,OtherSubIt>& o,
- typename std::enable_if<
- std::is_convertible<OtherSubIt,SubIt>::value >::type* = 0)
- : ahm_(o.ahm_)
- , subMap_(o.subMap_)
- , subIt_(o.subIt_)
- {}
+ ahm_iterator(
+ const ahm_iterator<OtherContT, OtherVal, OtherSubIt>& o,
+ typename std::enable_if<
+ std::is_convertible<OtherSubIt, SubIt>::value>::type* = nullptr)
+ : ahm_(o.ahm_), subMap_(o.subMap_), subIt_(o.subIt_) {}
/*
* Returns the unique index that can be used for access directly
explicit csl_iterator(NodeT* node = nullptr) : node_(node) {}
template <typename OtherVal, typename OtherNode>
- csl_iterator(const csl_iterator<OtherVal, OtherNode> &other,
- typename std::enable_if<std::is_convertible<OtherVal, ValT>::value>::type*
- = 0) : node_(other.node_) {}
+ csl_iterator(
+ const csl_iterator<OtherVal, OtherNode>& other,
+ typename std::enable_if<
+ std::is_convertible<OtherVal, ValT>::value>::type* = nullptr)
+ : node_(other.node_) {}
size_t nodeSize() const {
return node_ == nullptr ? 0 :
}
const_iterator i(begin() + pos), finish(end());
for (; i != finish; ++i) {
- if (traits_type::find(s, n, *i) != 0) {
+ if (traits_type::find(s, n, *i) != nullptr) {
return i - begin();
}
}
pos = std::min(pos, length() - 1);
const_iterator i(begin() + pos);
for (;; --i) {
- if (traits_type::find(s, n, *i) != 0) {
+ if (traits_type::find(s, n, *i) != nullptr) {
return i - begin();
}
if (i == begin()) {
if (pos < length()) {
const_iterator i(begin() + pos), finish(end());
for (; i != finish; ++i) {
- if (traits_type::find(s, n, *i) == 0) {
+ if (traits_type::find(s, n, *i) == nullptr) {
return i - begin();
}
}
pos = std::min(pos, size() - 1);
const_iterator i(begin() + pos);
for (;; --i) {
- if (traits_type::find(s, n, *i) == 0) {
+ if (traits_type::find(s, n, *i) == nullptr) {
return i - begin();
}
if (i == begin()) {
template <typename, typename> static BiggerThanChar test(...);
public:
- enum { value = sizeof(test<T, U>(0)) == 1 };
+ enum { value = sizeof(test<T, U>(nullptr)) == 1 };
};
/**
public:
static constexpr bool has_lock_unique = true;
static constexpr bool has_lock_timed =
- decltype(timed_lock_test<Mutex>(0))::value;
+ decltype(timed_lock_test<Mutex>(nullptr))::value;
static constexpr bool has_lock_shared =
- decltype(lock_shared_test<Mutex>(0))::value;
+ decltype(lock_shared_test<Mutex>(nullptr))::value;
static constexpr bool has_lock_upgrade =
- decltype(lock_upgrade_test<Mutex>(0))::value;
+ decltype(lock_upgrade_test<Mutex>(nullptr))::value;
};
/**
union Data {
explicit Data() {
- pdata_.heap_ = 0;
+ pdata_.heap_ = nullptr;
}
PointerType pdata_;
// other than libstdc++. Someday if we deem it important to present
// identical undefined behavior for other platforms, we can re-visit this.
TEST(FBString, testConstructionFromLiteralZero) {
- EXPECT_THROW(fbstring s(0), std::logic_error);
+ EXPECT_THROW(fbstring s(nullptr), std::logic_error);
}
TEST(FBString, testFixedBugs) {
uint64_t nowMicro() {
timeval tv;
- gettimeofday(&tv, 0);
+ gettimeofday(&tv, nullptr);
return static_cast<uint64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
}