Re: abstract static methods (again)



On Sun, 18 Oct 2009 19:19:55 -0700, Peter Duniho wrote:

Tomas Mikula wrote:
I have searched this group for "abstract static methods" and found a
couple of threads, but I think none of them was discussing the kind of
semantics I am going to describe. As you might have guessed, I believe
it would be useful :). [...]

You aren't the first. However, in C++, C#, Java, and languages like
them, you simply are never going to have methods that are both virtual
and static. And since abstract implies virtual, that rules out abstract
static methods too.

I'm not talking about virtual static methods. In this case, abstract
would not imply virtual. My second use case could most probably be
accomplished in C++ by Concepts (though Concepts didn't make it to C+
+0x). In fact, it is achievable with current C++ templates, only without
compile time checking --- it is possible to call T::staticMethod() where
T is a template parameter.
.