change:
{ rl.remove(i);
to:
{ rl = rl.remove(i);
--
Javascript is what you use to allow third party programs you don't know
anything about and doing you know not what to run on your computer.
On Thu, Sep 02, 2021 at 02:28:23PM -0700, Charles Hixson via
Digitalmars-d-learn wrote:
[...]
> --
> Javascript is what you use to allow third part programs you don't know
> anything about and doing you know not what to run on your computer.
ROFL! I'm st^Wborrowing this for my quotes file. ;-)
Thanks. See below for what I did.
On 8/29/21 5:05 PM, Ali Çehreli via Digitalmars-d-learn wrote:
On 8/29/21 3:31 PM, Charles Hixson wrote:
> Thanks. I going to have to study:
>
> enum supportsCall = isIntegral!(typeof(T.init.%s()));
>
>
> for awhile to make any sense of that, but it looks like
On 8/29/21 3:31 PM, Charles Hixson wrote:
> Thanks. I going to have to study:
>
> enum supportsCall = isIntegral!(typeof(T.init.%s()));
>
>
> for awhile to make any sense of that, but it looks like just what I was
> looking for.
Trying to explain with comments:
// This is an eponymous template
Thanks. I going to have to study:
enum supportsCall = isIntegral!(typeof(T.init.%s()));
for awhile to make any sense of that, but it looks like just what I was
looking for.
On 8/29/21 2:41 PM, Ali Çehreli via Digitalmars-d-learn wrote:
On 8/29/21 11:32 AM, Charles H. wrote:
I've set up a
On 8/29/21 11:32 AM, Charles H. wrote:
I've set up a class template (so far untested) thus:
class AARL (T, ndx = "ndx")
if (isIntegral(T.init.ndx) )
If I'm correct, this should work for ndx an integer variable of T,
but I'd really like T to be able to be anything whic
On Thursday, 11 August 2016 at 20:43:13 UTC, Meta wrote:
On Thursday, 11 August 2016 at 18:11:30 UTC, Engine Machine
wrote:
[...]
It can be done, but you have to be explicit and should think
very carefully if this is really a good design.
struct X(int defaultSize = 100)
{
int size;
On Thursday, 11 August 2016 at 18:11:30 UTC, Engine Machine wrote:
I have the need, in some cases, to pass static information to a
template class but don't want it to affect its type.
import std.algorithm, core.stdc.stdlib;
struct X(int defaultSize = 100)
{
int Size;
int* p;
void foo(i
On 8/11/16 4:15 PM, Engine Machine wrote:
On Thursday, 11 August 2016 at 18:42:51 UTC, Steven Schveighoffer wrote:
On 8/11/16 2:11 PM, Engine Machine wrote:
I have the need, in some cases, to pass static information to a template
class but don't want it to affect its type.
import std.algorithm
On Thursday, 11 August 2016 at 18:42:51 UTC, Steven Schveighoffer
wrote:
On 8/11/16 2:11 PM, Engine Machine wrote:
I have the need, in some cases, to pass static information to
a template
class but don't want it to affect its type.
import std.algorithm, core.stdc.stdlib;
struct X(int defaultSi
Also, what if we use a class instead of a struct?
in this case they are both references to the same thing.
I see a problem with reflection though, as one could get the
template parameter value and it would wrong on conversion. D
takes the easy way out of just preventing complex and potentially
On Thursday, 11 August 2016 at 19:28:47 UTC, Lodovico Giaretta
wrote:
On Thursday, 11 August 2016 at 18:11:30 UTC, Engine Machine
wrote:
[...]
If, in your case, it is possible to use one type as the other,
then specify it.
I mean, implement a templated opAssign that allows you to
assign valu
On Thursday, 11 August 2016 at 18:11:30 UTC, Engine Machine wrote:
[...]
If, in your case, it is possible to use one type as the other,
then specify it.
I mean, implement a templated opAssign that allows you to assign
values of one instantiation to values of another. While doing so,
remember
On 8/11/16 2:42 PM, Steven Schveighoffer wrote:
On 8/11/16 2:11 PM, Engine Machine wrote:
I have the need, in some cases, to pass static information to a template
class but don't want it to affect its type.
import std.algorithm, core.stdc.stdlib;
struct X(int defaultSize = 100)
{
int Size;
On 08/11/2016 11:11 AM, Engine Machine wrote:
> I have the need, in some cases, to pass static information to a template
> class but don't want it to affect its type.
>
> import std.algorithm, core.stdc.stdlib;
> struct X(int defaultSize = 100)
> {
>int Size;
>int* p;
>void foo(int siz
On 8/11/16 2:11 PM, Engine Machine wrote:
I have the need, in some cases, to pass static information to a template
class but don't want it to affect its type.
import std.algorithm, core.stdc.stdlib;
struct X(int defaultSize = 100)
{
int Size;
int* p;
void foo(int size)
{
Size = m
On Thursday, 11 August 2016 at 18:11:30 UTC, Engine Machine wrote:
Is there any way to get D to understand I want do not want a
template parameter to be part of the type comparison?
No. Use a standard run-time parameter. Your problem can be solved
by defining a constructor.
On Thursday, 11 August 2016 at 18:11:30 UTC, Engine Machine wrote:
I have the need, in some cases, to pass static information to a
template class but don't want it to affect its type.
import std.algorithm, core.stdc.stdlib;
struct X(int defaultSize = 100)
{
int Size;
int* p;
void foo(i
On Saturday, 22 August 2015 at 17:08:36 UTC, Mike Parker wrote:
void arrayTest(T, int passing) (T arrayT) { ... }
I get 'cannot deduce function from argument types' errors.
Specifically stating the type of the function doesn't seem to
help:
test.arrayTest(float [])(farray, 1);
test.arrayTe
On Saturday, 22 August 2015 at 16:49:26 UTC, DarthCthulhu wrote:
I'm having difficulty understanding how templates operate as
function parameters.
Say I have this:
struct ArrayTest {
void arrayTest(T) (T arrayT) {
writeln(arrayT);
}
}
unittest {
ArrayTest te
Hello Ellery,
BCS wrote:
Hello Ellery,
Hello.
Today I was looking at the grammar for template value parameters and
realized I didn't know what the conditional expression is for in
TemplateValueParameter => BasicType Declarator :
ConditionalExpression
So what does it do?
(I assume = Condi
On Fri, Sep 25, 2009 at 6:48 PM, Ellery Newcomer
wrote:
> Christopher Wright wrote:
>> Ellery Newcomer wrote:
>>> Okay, let me rephrase that:
>>>
>>> When you have a preceded by a colon in a template value
>>> parameter, what are its semantics? Is it the same as a default parameter
>>> value? Is
Christopher Wright wrote:
> Ellery Newcomer wrote:
>> Okay, let me rephrase that:
>>
>> When you have a preceded by a colon in a template value
>> parameter, what are its semantics? Is it the same as a default parameter
>> value? Is it some sort of constraining expression? Is it a vestige?
>
> vo
Ellery Newcomer wrote:
Okay, let me rephrase that:
When you have a preceded by a colon in a template value
parameter, what are its semantics? Is it the same as a default parameter
value? Is it some sort of constraining expression? Is it a vestige?
void foo(T : int)(T value)
{
// value
BCS wrote:
> Hello Ellery,
>
>> Hello.
>>
>> Today I was looking at the grammar for template value parameters and
>> realized I didn't know what the conditional expression is for in
>>
>> TemplateValueParameter => BasicType Declarator : ConditionalExpression
>>
>> So what does it do?
>>
>> (I assu
Hello Ellery,
Hello.
Today I was looking at the grammar for template value parameters and
realized I didn't know what the conditional expression is for in
TemplateValueParameter => BasicType Declarator : ConditionalExpression
So what does it do?
(I assume = ConditionalExpression is the defau
26 matches
Mail list logo