arobenko / embxx

embxx - Embedded C++ Library
GNU General Public License v3.0
262 stars 35 forks source link

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

Open SlowTypist opened 1 year ago

SlowTypist commented 1 year ago

... 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".

arobenko commented 1 year ago
  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.
SlowTypist commented 1 year ago

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

arobenko commented 1 year ago

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