On Wednesday, 2 August 2017 at 15:38:12 UTC, Steven Schveighoffer
wrote:
On 8/2/17 11:06 AM, Timoses wrote:
On Wednesday, 2 August 2017 at 13:51:01 UTC, Steven
Schveighoffer wrote:
However, your original code has potential as an enhancement
request, as the type is known at compile-time and coul
On Wednesday, 2 August 2017 at 12:07:46 UTC, Timoses wrote:
Hey,
wondering whether it's possible to access the derived type from
a function template in the base class or interface.
[...]
Created an enhancement issue:
https://issues.dlang.org/show_bug.cgi?id=17714
On 8/2/17 11:06 AM, Timoses wrote:
On Wednesday, 2 August 2017 at 13:51:01 UTC, Steven Schveighoffer wrote:
However, your original code has potential as an enhancement request,
as the type is known at compile-time and could certainly be resolved
to pass in as the `this` template parameter.
I
Thanks Arafel, the alias workaround might just be a nice way to
put it.
On Wednesday, 2 August 2017 at 13:51:01 UTC, Steven Schveighoffer
wrote:
What you are looking for is virtual static methods, and D
doesn't have those. I don't know if there's a way to make it
work with existing features.
What you are looking for is virtual static methods, and D doesn't have
those. I don't know if there's a way to make it work with existing
features.
Well, there are interesting things to do:
https://dpaste.dzfl.pl/ed826ae21473
I don't know if that's what one would call "virtual static",
On 8/2/17 9:11 AM, Timoses wrote:
On Wednesday, 2 August 2017 at 12:49:12 UTC, Steven Schveighoffer wrote:
Thanks for the reply!
Not sure I understand correctly, though.
interface I {}
class A : I {}
void test(T)(T t) if(is(T: I))
{ writeln(T.type.stringof); }
void main()
{
A.test;
}
t
On 08/02/2017 02:07 PM, Timoses wrote:
Hey,
wondering whether it's possible to access the derived type from a
function template in the base class or interface.
this T does not seem to be working, I guess because it's a static
function and this does not exists?!
[...]
Any way I could
On Wednesday, 2 August 2017 at 12:49:12 UTC, Steven Schveighoffer
wrote:
On 8/2/17 8:07 AM, Timoses wrote:
Hey,
wondering whether it's possible to access the derived type
from a function template in the base class or interface.
this T does not seem to be working, I guess because it's a
stat
On 8/2/17 8:07 AM, Timoses wrote:
Hey,
wondering whether it's possible to access the derived type from a
function template in the base class or interface.
this T does not seem to be working, I guess because it's a static
function and this does not exists?!
Yep.
Any way I could accomplish
Hey,
wondering whether it's possible to access the derived type from a
function template in the base class or interface.
this T does not seem to be working, I guess because it's a static
function and this does not exists?!
interface I
{
static void test(this T)()
{
writeln(
On Thursday, 7 May 2015 at 11:18:17 UTC, Daniel Kozak wrote:
On Thursday, 7 May 2015 at 11:15:02 UTC, Daniel Kozak wrote:
On Thursday, 7 May 2015 at 11:08:50 UTC, Daniel Kozák wrote:
On Thu, 07 May 2015 10:46:19 +
Lemonfiend via Digitalmars-d-learn
wrote:
On Thursday, 7 May 2015 at 10
On Thursday, 7 May 2015 at 10:19:44 UTC, Lemonfiend wrote:
Is it not possible to have a static function template with the
same name as the non-static version?
struct S
{
int i;
auto foo(T)(int j) {
i=j;
}
static auto foo(T)(int j) {
S s;
s.foo!T(j
On Thursday, 7 May 2015 at 11:08:50 UTC, Daniel Kozák wrote:
On Thu, 07 May 2015 10:46:19 +
Lemonfiend via Digitalmars-d-learn
wrote:
On Thursday, 7 May 2015 at 10:43:28 UTC, Daniel Kozak wrote:
> On Thursday, 7 May 2015 at 10:39:09 UTC, Daniel Kozák wrote:
>>
>> On Thu, 07 May 2015 10:
On Thursday, 7 May 2015 at 11:15:02 UTC, Daniel Kozak wrote:
On Thursday, 7 May 2015 at 11:08:50 UTC, Daniel Kozák wrote:
On Thu, 07 May 2015 10:46:19 +
Lemonfiend via Digitalmars-d-learn
wrote:
On Thursday, 7 May 2015 at 10:43:28 UTC, Daniel Kozak wrote:
> On Thursday, 7 May 2015 at 1
On Thu, 07 May 2015 10:46:19 +
Lemonfiend via Digitalmars-d-learn
wrote:
> On Thursday, 7 May 2015 at 10:43:28 UTC, Daniel Kozak wrote:
> > On Thursday, 7 May 2015 at 10:39:09 UTC, Daniel Kozák wrote:
> >>
> >> On Thu, 07 May 2015 10:33:44 +
> >> Vadim Lopatin via Digitalmars-d-learn
> >
On Thursday, 7 May 2015 at 10:43:28 UTC, Daniel Kozak wrote:
On Thursday, 7 May 2015 at 10:39:09 UTC, Daniel Kozák wrote:
On Thu, 07 May 2015 10:33:44 +
Vadim Lopatin via Digitalmars-d-learn
wrote:
struct S
{
int i;
auto foo2(T)(int j) {
i=j;
}
static S foo(T)(i
On Thursday, 7 May 2015 at 10:39:09 UTC, Daniel Kozák wrote:
On Thu, 07 May 2015 10:33:44 +
Vadim Lopatin via Digitalmars-d-learn
wrote:
struct S
{
int i;
auto foo2(T)(int j) {
i=j;
}
static S foo(T)(int j) {
S s;
s.foo2!T(j);
retu
On Thursday, May 07, 2015 10:19:42 Lemonfiend via Digitalmars-d-learn wrote:
> Is it not possible to have a static function template with the
> same name as the non-static version?
No. Unfortunately, you can't overload based on static. I believe that it
works if they're overload
On Thu, 07 May 2015 10:33:44 +
Vadim Lopatin via Digitalmars-d-learn
wrote:
> struct S
> {
> int i;
>
> auto foo2(T)(int j) {
> i=j;
> }
>
> static S foo(T)(int j) {
> S s;
> s.foo2!T(j);
> return s;
> }
> }
>
> void main()
> {
On Thu, 07 May 2015 10:19:42 +
Lemonfiend via Digitalmars-d-learn
wrote:
> Is it not possible to have a static function template with the
> same name as the non-static version?
>
> struct S
> {
> int i;
>
> auto foo(T)(int j) {
> i=j;
>
On Thursday, 7 May 2015 at 10:19:44 UTC, Lemonfiend wrote:
Is it not possible to have a static function template with the
same name as the non-static version?
struct S
{
int i;
auto foo(T)(int j) {
i=j;
}
static auto foo(T)(int j) {
S s;
s.foo!T(j
On Thu, 07 May 2015 10:19:42 +
Lemonfiend via Digitalmars-d-learn
wrote:
> Is it not possible to have a static function template with the
> same name as the non-static version?
>
> struct S
> {
> int i;
>
> auto foo(T)(int j) {
> i=j;
>
Is it not possible to have a static function template with the
same name as the non-static version?
struct S
{
int i;
auto foo(T)(int j) {
i=j;
}
static auto foo(T)(int j) {
S s;
s.foo!T(j);
return s;
}
}
void main()
{
auto s = S.foo
On 2011-07-16 23:34, Christopher the Magnificent wrote:
I see this code AT THE TOP (MODULE) LEVEL of one of Michel Fortin's
D/Objective-C bridge source files and I'm trying to wrap my head around it.
/** Wrap an object instance within an object of this class. */
static Object
objcCreateWrapper(T
I see this code AT THE TOP (MODULE) LEVEL of one of Michel Fortin's
D/Objective-C bridge source files and I'm trying to wrap my head around it.
/** Wrap an object instance within an object of this class. */
static Object
objcCreateWrapper(T)(id instance)
{
25 matches
Mail list logo