embxx icon indicating copy to clipboard operation
embxx copied to clipboard

Trying to compile the StaticQueue in STM32cubeIde (arm-none-eabi) throws an error

Open SlowTypist opened this issue 2 years ago • 3 comments

... template <typename T> class StaticQueueBase<T>::ConstIterator : public StaticQueueBase<T>::template IteratorBase<typename StaticQueueBase<T>::ConstIterator, const StaticQueueBase<T> > { ... template <typename T> class StaticQueueBase<T>::Iterator : public StaticQueueBase<T>::template IteratorBase<typename StaticQueueBase<T>::Iterator, StaticQueueBase<T> > { ...

throws an error "expected class-name before '{' token".

SlowTypist avatar Jun 25 '23 08:06 SlowTypist

  1. Insufficient information is provided to help identify the problem.
  2. This library was developed more than 10 years ago with older compilers and is not really maintained.

arobenko avatar Jun 25 '23 23:06 arobenko

It is about this line https://github.com/arobenko/embxx/blob/edd548239a10bb7c8fda32ddb445305289bfe805/embxx/container/StaticQueue.h#L1166 and this https://github.com/arobenko/embxx/blob/edd548239a10bb7c8fda32ddb445305289bfe805/embxx/container/StaticQueue.h#L1188

SlowTypist avatar Jun 26 '23 07:06 SlowTypist

Without seeing full errors dump I'm not sure what you compiler dislikes. Try adding typename between public and StaticQueueBase<T>.

class StaticQueueBase<T>::ConstIterator :
            public typename StaticQueueBase<T>::template
                IteratorBase<typename StaticQueueBase<T>::ConstIterator, const StaticQueueBase<T> >

arobenko avatar Jun 29 '23 08:06 arobenko