diff --git a/TinySTL/List.h b/TinySTL/List.h index f61971c..21a773c 100644 --- a/TinySTL/List.h +++ b/TinySTL/List.h @@ -186,8 +186,9 @@ namespace TinySTL{ nodePtr newNode(const T& val = T()){ nodePtr res = nodeAllocator::allocate(); res->container = this; - //res->data = val; -> bug - nodeAllocator::construct(&(res->data), val);//fix + //res->data = val; //-> bug + //nodeAllocator::construct(&(res->data), val); + TinySTL::construct(&(res->data), val);//fix res->prev = nullptr; res->next = nullptr; return res; @@ -215,7 +216,8 @@ namespace TinySTL{ friend bool operator== (const list& lhs, const list& rhs); template friend bool operator!= (const list& lhs, const list& rhs); - }; + };//end of List + template void list::push_front(const value_type& val){ auto node = newNode(val);