Compare commits

..

No commits in common. "main" and "v1.0.0" have entirely different histories.
main ... v1.0.0

2 changed files with 0 additions and 31 deletions

View File

@ -23,7 +23,6 @@
#pragma once
#include <atomic>
#include <cstddef>
#include <functional>
#include <type_traits>
@ -60,16 +59,6 @@ public:
}
}
rcp & operator=(nullptr_t) noexcept
{
if (ptr)
{
ptr->rcp_dec();
ptr = nullptr;
}
return *this;
}
rcp & operator=(const rcp & other)
{
if (ptr != other.ptr)

View File

@ -448,25 +448,6 @@ void test_external_class()
assert(external_destruct == before + 2);
}
void test_assign_nullptr()
{
int constructed_before = mybase_construct;
int destructed_before = mybase_destruct;
{
rcp<MyBase> base = MyBase::create(6, 6);
assert(mybase_construct == constructed_before + 1);
assert(mybase_destruct == destructed_before);
base = nullptr;
assert(mybase_construct == constructed_before + 1);
assert(mybase_destruct == destructed_before + 1);
base = nullptr;
assert(mybase_construct == constructed_before + 1);
assert(mybase_destruct == destructed_before + 1);
}
assert(mybase_construct == constructed_before + 1);
assert(mybase_destruct == destructed_before + 1);
}
int main(int argc, char * argv[])
{
test_class_hierarchy();
@ -496,6 +477,5 @@ int main(int argc, char * argv[])
test_hash();
test_class_template();
test_external_class();
test_assign_nullptr();
return 0;
}