Re: Giant template - changing types everywhere

2023-07-14 Thread Cecil Ward via Digitalmars-d-learn
On Friday, 14 July 2023 at 14:15:29 UTC, Steven Schveighoffer wrote: On 7/14/23 1:51 AM, Cecil Ward wrote: [...] So templates don't automatically instantiate, you have to specify them. And then if your function is inside the template, to access it, you will need to do: [...] I can give

Re: Giant template - changing types everywhere

2023-07-14 Thread Christian Köstlin via Digitalmars-d-learn
On 14.07.23 18:51, Steven Schveighoffer wrote: On 7/14/23 12:40 PM, Christian Köstlin wrote: Would Eponymous Templates (https://dlang.org/spec/template.html#implicit_template_properties) work with the wrapping template? Only if all the functions are named the same as the template. With

Re: Giant template - changing types everywhere

2023-07-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/14/23 12:40 PM, Christian Köstlin wrote: Would Eponymous Templates (https://dlang.org/spec/template.html#implicit_template_properties) work with the wrapping template? Only if all the functions are named the same as the template. With eponymous templates, you no longer get access to

Re: Giant template - changing types everywhere

2023-07-14 Thread Christian Köstlin via Digitalmars-d-learn
On 14.07.23 16:15, Steven Schveighoffer wrote: On 7/14/23 1:51 AM, Cecil Ward wrote: On Friday, 14 July 2023 at 05:09:58 UTC, Cecil Ward wrote: On Friday, 14 July 2023 at 05:05:27 UTC, Cecil Ward wrote: On Friday, 14 July 2023 at 05:03:31 UTC, Cecil Ward wrote: The way I can see it going is

Re: Giant template - changing types everywhere

2023-07-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/14/23 1:51 AM, Cecil Ward wrote: On Friday, 14 July 2023 at 05:09:58 UTC, Cecil Ward wrote: On Friday, 14 July 2023 at 05:05:27 UTC, Cecil Ward wrote: On Friday, 14 July 2023 at 05:03:31 UTC, Cecil Ward wrote: The way I can see it going is a giant template encompassing pretty much the

Re: Giant template - changing types everywhere

2023-07-13 Thread Cecil Ward via Digitalmars-d-learn
On Friday, 14 July 2023 at 05:09:58 UTC, Cecil Ward wrote: On Friday, 14 July 2023 at 05:05:27 UTC, Cecil Ward wrote: On Friday, 14 July 2023 at 05:03:31 UTC, Cecil Ward wrote: On Friday, 14 July 2023 at 01:34:54 UTC, Steven Schveighoffer wrote: [...] The way I can see it going is a giant

Re: Giant template - changing types everywhere

2023-07-13 Thread Cecil Ward via Digitalmars-d-learn
On Friday, 14 July 2023 at 05:05:27 UTC, Cecil Ward wrote: On Friday, 14 July 2023 at 05:03:31 UTC, Cecil Ward wrote: On Friday, 14 July 2023 at 01:34:54 UTC, Steven Schveighoffer wrote: [...] The way I can see it going is a giant template encompassing pretty much the whole file. Does that

Re: Giant template - changing types everywhere

2023-07-13 Thread Cecil Ward via Digitalmars-d-learn
On Friday, 14 July 2023 at 05:03:31 UTC, Cecil Ward wrote: On Friday, 14 July 2023 at 01:34:54 UTC, Steven Schveighoffer wrote: [...] The way I can see it going is a giant template encompassing pretty much the whole file. Does that mean that the caller who calls my one public function does

Re: Giant template - changing types everywhere

2023-07-13 Thread Cecil Ward via Digitalmars-d-learn
On Friday, 14 July 2023 at 01:34:54 UTC, Steven Schveighoffer wrote: On 7/13/23 8:08 PM, Cecil Ward wrote: What I really want to do though is provide one single templated function with the kind of characters / strings as a parameter. I want to have something like T Transform( T )( T str)

Re: Giant template - changing types everywhere

2023-07-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/13/23 8:08 PM, Cecil Ward wrote: What I really want to do though is provide one single templated function with the kind of characters / strings as a parameter. I want to have something like T Transform( T )( T str) called as auto result = Transform!(dstring)( dstring str ); ```d T[]

Giant template - changing types everywhere

2023-07-13 Thread Cecil Ward via Digitalmars-d-learn
Some advice on a couple of points. I have been working on a module that works on either dchar / dstrings or wchar / wstrings with just two changes of alias definitions and a recompile. What I really want to do though is provide one single templated function with the kind of characters /