SH
Size: a a a
SH
SI
bufList.head = new SinglyLinkedList(other.head);
это что такое?SI
s
SI
SI
template<typename T>
SinglyLinkedList<T>::SinglyLinkedList(const SinglyLinkedList& other)
{
while (current->pNext != nullptr)
{
this->push_back(current->data);
++this->size;
current = current->pNext;
}
}
SI
SI
D
AM
D
template <typename TPointer>
constexpr inline is_raw_or_unique_ptr = std::is_pointer_v<TPointer>
|| std::is_same_v<TPointer, std::unique_ptr<typename std::pointer_traits<TPointer>::element_type>>;
template <typename TPointer>
void foo()
{
static_assert(is_raw_or_unique_ptr<TPointer>, "TPointer should be raw or unique pointer");
}
AM
D
AM
D
s
template<typename T>
SinglyLinkedList<T>::SinglyLinkedList(const SinglyLinkedList &other): SinglyLinkedList(){
for(auto current = other.head; current != nullptr; current = current->pNext){
push_back(current->data);
}
}
AM
template <typename TPointer>
constexpr inline is_raw_or_unique_ptr = std::is_pointer_v<TPointer>
|| std::is_same_v<TPointer, std::unique_ptr<typename std::pointer_traits<TPointer>::element_type>>;
template <typename TPointer>
void foo()
{
static_assert(is_raw_or_unique_ptr<TPointer>, "TPointer should be raw or unique pointer");
}
MyTemplate<int>
MyTemplate<int*>
MyTemplate<unique_ptr<int» «« вот тут же может произойти что то не хорошее?
SI
template<typename T>
SinglyLinkedList<T>::SinglyLinkedList(const SinglyLinkedList &other): SinglyLinkedList(){
for(auto current = other.head; current != nullptr; current = current->pNext){
push_back(current->data);
}
}
ПК
MyTemplate<int>
MyTemplate<int*>
MyTemplate<unique_ptr<int» «« вот тут же может произойти что то не хорошее?
AM