Если я typedef
какой-то тип в структуре (функторе), это область видимости typedef
локально в структуре?
Рассмотрим следующий пример, в котором я определил foo как int
и double
в двух отдельных функторах. Это правильный пример?
template <typename T>
struct firstfunctor
{
typedef int foo;
foo operator()(const foo& a, const foo& b)
{
return /*whatever*/
}
};
template <typename T>
struct secondfunctor
{
typedef double foo;
foo operator()(const foo& a, const foo& b)
{
return /*whatever*/
}
};