ctrl ++ queue with shared _ptr

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
2 posts • Page 1 of 1
schu
Posts:10
Joined: Tue Dec 06, 2016 10:43 am

ctrl ++ queue with shared _ptr

Post by schu »

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++ ?

ChristianGoehring
Posts:14
Joined: Fri Feb 24, 2017 9:29 am

Re: ctrl ++ queue with shared _ptr

Post by ChristianGoehring »

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.

2 posts • Page 1 of 1