I have the following class: template<typename Trait, Value> class Storage
. In one application where I use this class, I want to create a synonym for Storage
that "auto-fills" in the Value
to be ValueA
. However, as the class is used elsewhere, it doesn't make sense to have Value be set to ValueA
in Storage's definition.
I've attempted to create a typedef within the header for Storage, but I keep running into compiler errors. Essentially what I'm trying to accomplish is:
template<typename trait>
typedef Storage<trait, ValueA> MyStorage<trait>;
So that I can use different traits, but have the value being stored automatically set. The error I get when I try this approach is error: template declaration of 'typedef'
Is there anyway around this limitation in C++03?