simplifying my problem we can consider:
template <class T>
class Base{
typedef typename std::pair<T, T> pair;
};
template <class T>
class Inheritor : public Base<T> {
pair *p;
// mean that we want to use constructor of std::pair.
// say: std::pair withou argument list
Inheritor<T>::pair *p;
// dont see his typename
// say: pair does not name a type
typename pair *p;
// I was sure that it works.
// I dont know why it doesnt work.
// say: expected nested-name-specifier before 'pair
typename Inheritor<T>::pair *p;
// ok!
};
why we cant write typename pair *p ? I dont understand reasons of Inheritor:: ! it make code more complex and bad to read!
PS (of cource public. as I say "simplifying my problem...")
typedef typename Base<T>::pair pair;
In my mind it is a ... russian word that is hard to translate ("костыль")
It look like Kludge or duct tape or hack =)
As I understand:
typedefs inherit as usual function or variable. but it is not accessible (!!!). to acess it we should write
typedef typename Base<T>::pair pair;
or
typedef typename Inheritor<T>::pair pair;
it looks like funny Hindu code but we needs it! (>_<)''''
of cource in public scope