[Issue 5217] Permit static+abstract
https://issues.dlang.org/show_bug.cgi?id=5217 Mathias LANG changed: What|Removed |Added Status|NEW |RESOLVED CC||pro.mathias.l...@gmail.com Resolution|--- |WONTFIX --- Comment #6 from Mathias LANG --- Since this is a debatable enhancement request, and hasn't seen much activity for a while, I'm going to close it and suggest opening a DIP if you want to pursue this. https://github.com/dlang/DIPs/ --
[Issue 5217] Permit static+abstract
http://d.puremagic.com/issues/show_bug.cgi?id=5217 --- Comment #5 from Jonathan M Davis 2010-11-16 19:42:08 PST --- Hmm. I think that I get what you're getting at, though it is a bit odd. Certainly, requiring static functions is something different. I've never seen a language do that. I'd still think that you could do it with a static if or template constraint, but without seeing the code, I'm not sure that it's clear enough exactly what you're trying to for me to give any kind of real suggestion about how to g about it with D as it is. In general, I don't think that I support the idea of enforcing that a type have a particular set of static functions, but it does seem like a perfectly legitimate enhancement request. I'm inclined to think that you should probably be doing things a different way. But I'm not familiar with your code, so I obviously can't say for sure. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5217] Permit static+abstract
http://d.puremagic.com/issues/show_bug.cgi?id=5217 --- Comment #4 from Austin Hastings 2010-11-16 18:53:00 PST --- Template constraints do not work. The problem is not "The input type must behave in such-and-such manner," but rather "Here is a template for most, but not all, of the class: you must provide two static methods that I have marked as abstract." -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5217] Permit static+abstract
http://d.puremagic.com/issues/show_bug.cgi?id=5217 --- Comment #3 from Jonathan M Davis 2010-11-16 17:01:57 PST --- Do template constraints not work for you in this case? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5217] Permit static+abstract
http://d.puremagic.com/issues/show_bug.cgi?id=5217 --- Comment #2 from Austin Hastings 2010-11-16 16:00:37 PST --- What I'm asking for is "abstract static". That is, a syntax for imposing a requirement that a class (or struct) provide a static member function before it can be instantiated. In my particular use case, I've got a template and would like to impose a requirement for a factory method on any realizations of the template. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5217] Permit static+abstract
http://d.puremagic.com/issues/show_bug.cgi?id=5217 Jonathan M Davis changed: What|Removed |Added CC||jmdavisp...@gmx.com --- Comment #1 from Jonathan M Davis 2010-11-14 16:21:20 PST --- I'm afraid that you're going to have to be more clear in what you mean. abstract indicates that a function does not have a body and that derived types must give an implementation if they are to be instantiatable. static functions have nothing to do with the virtual table, and so they don't care about base or derived types. They're essentially just namespaced within a class or struct. abstract has no meaning for them. Templates _always_ result in code. What does it matter if that code is a static function, within a class, a struct, or whatever? An abstract template makes no sense. Even if you're instantiating a template within a base class, it must be fully instantiated within that class regardless of whether any classes will ever be derived from that class. What are you trying to do here? You need to be clearer, because as it stands, what you're asking for makes no sense. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---