ivanseidel / LinkedList

🔗 A fully implemented LinkedList made to work with general Microcontrollers and Arduino projects
MIT License
347 stars 120 forks source link

Added support for indexing like an array and const functions. #11

Closed finitespace closed 5 years ago

ivanseidel commented 8 years ago

Hi @finitespace, can you explain more about the improvements?

finitespace commented 8 years ago

Yes, you can treat the linked list like an array. For example:

int myvalue = myLinkList[0];

Constant functions are required for this type of indexing.

ivanseidel commented 8 years ago

Now I get it. However, the iterator method has been copied. Make a call for the original one from the new one, so that we can simplify the code as much as we can please

finitespace commented 8 years ago

Unfortunately that is not possible.

It was copied because it must be a constant function. You cannot call a non constant function from a constant function.

ivanseidel commented 5 years ago

Thanks for the PR! This is now in production