D - templates and functions
- Daniel (23/23) Sep 08 2011 Hi,
- Simen Kjaeraas (5/30) Sep 08 2011 This newsgroup is deprecated. Please use digitalmars.D.learn instead.
- Steve Teale (6/6) Sep 30 2011 Simen,
Hi, I'm trying to reimplement something like this C++ code in D: template<Class T> Class A { ... } template<Class T> A<T> some_function() { ... } While I can implement the class: class A(X) { ... } I fail with the function, due to the fact that I don't know/find the correct syntax for this. The version A(X) some_function() { } fails with the message function declaration without return type. (Note that constructors are always named 'this') which is understandable. Any idea how the correct syntax is? Thanx, daniel
Sep 08 2011
On Thu, 08 Sep 2011 18:52:52 +0200, Daniel <daniel.lincke pik-potsdam.de> wrote:Hi, I'm trying to reimplement something like this C++ code in D: template<Class T> Class A { ... } template<Class T> A<T> some_function() { ... } While I can implement the class: class A(X) { ... } I fail with the function, due to the fact that I don't know/find the correct syntax for this. The version A(X) some_function() { } fails with the message function declaration without return type. (Note that constructors are always named 'this') which is understandable. Any idea how the correct syntax is? Thanx, danielThis newsgroup is deprecated. Please use digitalmars.D.learn instead. -- Simen
Sep 08 2011
Simen, We're all deprecated sooner or later - some of us sooner than others. One gets the feeling that there is a politburo that controls D. Could you be so good as to publish the names of the central committee? You sound like somebody out of Kafka - lighten up! Steve
Sep 30 2011