0
Does this have any memory issue
Refer code below: https://www.sololearn.com/en/compiler-playground/cMRzn4OjzvRN Does this have any memory or other issue? I tried and it works fine , but I was told about code having issue. Could any one please help to identify issue or confirm my understanding of no issue?
3 Answers
+ 1
why not just use c++ std::forward_list if you want singly-linked list?
std::list would be for doubly-linked list.
https://en.cppreference.com/w/cpp/container/forward_list
+ 1
I can definitely use it and I always use the same when doing production code
This query is on actual implementation of list which we should try to implement as a part of learning.
+ 1
Ketan Lalcheta
Good point.
ok. Maybe dive into the stl souce code to find some idea on how they decided to implement it?