K
Krzysztof Poc
Hi
I have the following code.
template <class T>
class Frame {
typename T::areaT m_area;
public:
typename T::areaT set ( typename T::areaT area ) {}
};
class Rectangle {
public:
typedef int areaT;
};
int main ( void )
{
Frame < Rectangle > r;
return 0;
}
I would like to define a Frame<T>::set function outside of class
definition.
I did it as follows.
template <class T>
typename T::areaT Frame<T>::set ( typename T::areaT area ) {}
It compiles but I'm not sure whether it is correct.
Could you please confirm it. In case it isn't correct please type a
correct
one.
thanks
I have the following code.
template <class T>
class Frame {
typename T::areaT m_area;
public:
typename T::areaT set ( typename T::areaT area ) {}
};
class Rectangle {
public:
typedef int areaT;
};
int main ( void )
{
Frame < Rectangle > r;
return 0;
}
I would like to define a Frame<T>::set function outside of class
definition.
I did it as follows.
template <class T>
typename T::areaT Frame<T>::set ( typename T::areaT area ) {}
It compiles but I'm not sure whether it is correct.
Could you please confirm it. In case it isn't correct please type a
correct
one.
thanks