Update test and documentation

This commit is contained in:
Glen Fernandes
2019-05-13 22:11:20 -04:00
parent ca832d9384
commit c96dfcec4a
4 changed files with 22 additions and 12 deletions

View File

@@ -47,15 +47,14 @@ struct creator {
::operator delete(ptr);
}
template<class U, class V>
void construct(U* ptr, const V& value) {
::new(static_cast<void*>(ptr)) U(value + 1);
template<class V>
void construct(type* ptr, const V& value) {
::new(static_cast<void*>(ptr)) type(value + 1);
++type::count;
}
template<class U>
void destroy(U* ptr) {
ptr->~U();
void destroy(type* ptr) {
ptr->~type();
--type::count;
}
};