bl**********@gm ail.com wrote:
The author's
The author of what?
reason is "because its hard to write templates that dont
know whether or not an operation is a member for a given type". What
does he mean by this? An example is appreciated.
What is the context?
If I had to speculate, the "author" you're quoting (?) speaks of template
code similar to
template<class T> void foo(T t)
{
// if T has a member 'bar', use it
t.bar();
// else, don't use it, use some global function
::bar(t);
}
Such template is rather difficult to implement, but possible, using SFINAE
technique. Look up "has_member " in the archives.
V