I use templates, and I am annoyed with calling the functions with the template parameters. Example:
I have a templated structure
template<typename T>
struct telement {
typedef {
T element;
float some_value;
} type;
};
telement<float>::type theElement;
and I have a function:
template<typename T>
float do_some_stuff( const typename telement<T>::type& x) {
// ...
}
Unfortulately, g++ complains when I call
do_some_stuff( theElement );
and I must call:
do_some_stuff<float>( theElement );
Can I avoid template specification each time I call the function? I thought that compiler should figure out the type automagically...