0

I want to create a thread safe fifo list using Loki library, but I can't create a guard because I'm using gcc 4.3 and it doesn't support alias templates:

....
template <typename T> MyFIFO: public ObjectLevelLockable<MyFIFO<T>>{
....
typedef MyFIFO<T>::Lock MyLock;
....
void some_function(const T& some_variable_name)
{
MyLock _lock(*this);//like in "Modern c++ Design p268"
....some code...
}

Any ideas... without installing gcc 4.7?

markalex
  • 8,623
  • 2
  • 7
  • 32
LucianMLI
  • 183
  • 1
  • 11

1 Answers1

3

typename MyFIFO<T>::Lock is a dependent name, so you need a typename here:

typedef typename MyFIFO<T>::Lock MyLock;
        ^^^^^^^^
juanchopanza
  • 223,364
  • 34
  • 402
  • 480
  • Great thank you, but now I get a call member without object... I think it has some more broken code. – LucianMLI Jan 06 '14 at 15:05
  • I get it on _lock(*this).. I copied(by hand) the Loki lib, the multithread part, so might have missed something. – LucianMLI Jan 06 '14 at 15:08