Hello,
Is it possible to create a queue object simply like a linked list, with shared_pointer, which are pointing head(shows the first element) and tail(shows the last element) ?. if it is possible could you share a sample code with ctrl++ ?
ctrl ++ queue with shared _ptr
- ChristianGoehring
- Posts:14
- Joined: Fri Feb 24, 2017 9:29 am
Re: ctrl ++ queue with shared _ptr
Hi!
I am not sure if that is the correct approach for your problem, but for queues in Ctrl I was simply using dyn_ elements. Just return the first or last element by index for your use case. With Ctrl++, you could wrap it with a class that has the according member functions for accessing tail or head etc.
I am not sure if that is the correct approach for your problem, but for queues in Ctrl I was simply using dyn_ elements. Just return the first or last element by index for your use case. With Ctrl++, you could wrap it with a class that has the according member functions for accessing tail or head etc.