J
Jan
Hi Folks,
I was reading Andrei Alexandrescu's Modern C++ Design and I decided to
get my hands dirty with the code.
I tried implementing parts of his code and tried to put up a simple
AbstractFactory.
I ran into some compile issues.
My main.cpp is here http://codepad.org/cGsBF3Ba
My AbstractFactoryClass header file is here http://codepad.org/Z4iQnOGQ
My TypesCollection header file is here http://codepad.org/SEDgJF14
I get the following error when I try to compile this code:
main.cpp: In function 'main':
main.cpp:59: error: expected primary-expression before '>' token
main.cpp:49: error: expected primary-expression before ')' token
main.cpp:50: error: expected primary-expression before '>' token
main.cpp:50: error: expected primary-expression before ')' token
I tried fixing this by changing Line 26 in AbstractFactoryClass header
above
from : return unit.Create(TypeMapping<T>());
to : return unit.template Create(TypeMapping<T>());
but that does not fix this error either and I got the same errors
above.
I would be grateful if someone can help me with this error.
On the same note, I would like to add that I get the same error when I
try to use Alexandrescu's Loki library. So maybe my understanding
itself is wrong. Kindly help me learn.
Regards
Janani
I was reading Andrei Alexandrescu's Modern C++ Design and I decided to
get my hands dirty with the code.
I tried implementing parts of his code and tried to put up a simple
AbstractFactory.
I ran into some compile issues.
My main.cpp is here http://codepad.org/cGsBF3Ba
My AbstractFactoryClass header file is here http://codepad.org/Z4iQnOGQ
My TypesCollection header file is here http://codepad.org/SEDgJF14
I get the following error when I try to compile this code:
main.cpp: In function 'main':
main.cpp:59: error: expected primary-expression before '>' token
main.cpp:49: error: expected primary-expression before ')' token
main.cpp:50: error: expected primary-expression before '>' token
main.cpp:50: error: expected primary-expression before ')' token
I tried fixing this by changing Line 26 in AbstractFactoryClass header
above
from : return unit.Create(TypeMapping<T>());
to : return unit.template Create(TypeMapping<T>());
but that does not fix this error either and I got the same errors
above.
I would be grateful if someone can help me with this error.
On the same note, I would like to add that I get the same error when I
try to use Alexandrescu's Loki library. So maybe my understanding
itself is wrong. Kindly help me learn.
Regards
Janani