Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: VDR developer version 1.3.6



Marcel Wiesweg wrote:

I have to admit that I don't quite understand where the problem is here.
Why doesn't

 T *l = (T *)First();

work any more? After all, there is no other item named "First" anywhere
near. What am I missing?

The changes are explained at http://gcc.gnu.org/gcc-3.4/changes.html
section "C++".
If I understand that correctly in a situation like

template <class T > class Parent {
public: int f();
};
...
int f();
...
template <class T > class MyClass : public Parent {
void xy() { f(); }
}

in xy() the global function f will be called.
_Why_ this is done we will probably have to ask some g++ developer or Mr. Stroustrup himself.
There are Situations where the compiler has little or no chance to find out what you're trying to use (its hard in case you use template specialisation).


template <typename foo>
class base
{
void bar();
};

template <>
class base<int>
{
};

template <typename foo>
class derived : public base<foo>
{
public:

void problem()
{
// which one ?
bar();
}
};

void bar();


somemethod:

derived<int> blubb;
blubb.bar();


Now its getting problematic for the compiler, he does not know if you want to use derived::bar or ::bar ...



kind regards Philip


--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index