On Friday, 22 May 2015 at 06:28:16 UTC, Ali Çehreli wrote:
http://ddili.org/ders/d.en/operator_overloading.html#ix_operator_overloading.opSlice
http://ddili.org/ders/d.en/templates_more.html#ix_templates_more.overloading,%20operator
Ali
Thanks, Ali. I've actually looked over that already
On Friday, 22 May 2015 at 05:49:17 UTC, weaselcat wrote:
http://forum.dlang.org/thread/luadir$t0g$1...@digitalmars.com#post-luadir:24t0g:241:40digitalmars.com
Thanks!
On 05/21/2015 11:20 PM, Mike Parker wrote:
On Friday, 22 May 2015 at 05:49:17 UTC, weaselcat wrote:
http://forum.dlang.org/thread/luadir$t0g$1...@digitalmars.com#post-luadir:24t0g:241:40digitalmars.com
Thanks!
For convenience, here are the two sections that cover my understanding
of this
On Thursday, 21 May 2015 at 21:49:55 UTC, Freddy wrote:
std.traits has ImplicitConversionTargets.
Is there any template that returns the types that can implicty
convert to T?
I doubt that, because it's an open set (alias this, inheritance).
However, it should be possible to iterate over all
On SO[1] I got next answer:
What happens when you launch a D application ? The entry point
is a C main inside the runtime, which initialize it (the
runtime), including module constructor, run the unittest (if
you've compiled with -unittest), then call your main (which name
is _Dmain - useful
Timon Gehr wrote:
template getDepth(T){
static if(is(T==Set!S,S)) enum getDepth=1+getDepth!S;
else enum getDepth=0;
}
Thx. Seems that I have to relearn a lot.
-manfred
Matt Kline wrote:
isn't making any use of the template argument T
Correct. I do not know how to use `T' to determine the recursion depth of
the template---and I want no further parameter.
-manfred
On 05/23/2015 12:12 AM, Manfred Nowak wrote:
Matt Kline wrote:
isn't making any use of the template argument T
Correct. I do not know how to use `T' to determine the recursion depth of
the template---and I want no further parameter.
-manfred
import std.stdio, std.range, std.algorithm;
How can one determine the recursion depth for templated types?
Example code:
import std.stdio;
class Set(T){
override string toString(){
return Set;
}
}
void main(){
auto s0= new Set!uint;
writeln( s0); // writes Set
auto s1= new Set!(Set!uint);
writeln( s1); // should write
On Friday, 22 May 2015 at 05:31:38 UTC, Ali Çehreli wrote:
Here is my attempt:
import std.stdio;
import std.algorithm;
import std.conv;
import std.range;
void main()
{
// Replace 'none' with 'all' to activate.
version (none) {
const n = 5;
auto a = stdin
By the way, Python has deepDup :)
http://rextester.com/KBFA82886
[code]
import std.stdio;
public void setMarker(M)( size_t markerIndex, M markerValue )
if(
is(M: ulong) || is(M: long) ||
is(M: uint) || is(M: int) ||
is(M: ushort) || is(M: short) ||
is(M: ubyte) || is(M: byte) || is(M:
On Saturday, 23 May 2015 at 04:35:55 UTC, tcak wrote:
[code]
import std.stdio;
public void setMarker(M)( size_t markerIndex, M markerValue )
if(
is(M: ulong) || is(M: long) ||
is(M: uint) || is(M: int) ||
is(M: ushort) || is(M: short) ||
On Friday, 22 May 2015 at 21:13:50 UTC, Manfred Nowak wrote:
How can one determine the recursion depth for templated types?
Example code:
import std.stdio;
class Set(T){
override string toString(){
return Set;
}
}
void main(){
auto s0= new Set!uint;
writeln( s0); // writes Set
On Thursday, 21 May 2015 at 21:49:55 UTC, Freddy wrote:
std.traits has ImplicitConversionTargets.
Is there any template that returns the types that can implicty
convert to T?
You can write something like this:
---
import std.stdio;
import std.traits;
import std.typetuple;
void main(string[]
I have a code which does a lot of work on 2D/3D arrays, for which
I use the 2.066 multidimensional slicing syntax through a fork of
the Unstandard package [1].
Many times the order of operations doesn't matter and I thought I
would give the parallelism module a try to try and get some easy
On Friday, 22 May 2015 at 06:36:27 UTC, Suliman wrote:
On SO[1] I got next answer:
What happens when you launch a D application ? The entry point
is a C main inside the runtime, which initialize it (the
runtime), including module constructor, run the unittest (if
you've compiled with
On Friday, 22 May 2015 at 11:13:43 UTC, Suliman wrote:
Am I right understand that that:
1. every App start from main()
2. Dmain is function that run after main is started and it's
run GC, unit-tests and so on?
Not really, it depends what you mean by main, the function called
main that you
On Friday, 22 May 2015 at 11:51:01 UTC, John Colvin wrote:
On Friday, 22 May 2015 at 11:13:43 UTC, Suliman wrote:
Am I right understand that that:
1. every App start from main()
2. Dmain is function that run after main is started and it's
run GC, unit-tests and so on?
Not really, it depends
the line warping on this forum deserve a big slap in the face...
Am I right understand that that:
1. every App start from main()
2. Dmain is function that run after main is started and it's run
GC, unit-tests and so on?
Really hard to understand...
So what what would call at first ?
extern(C) int main()
or
int _Dmain()
On Friday, 22 May 2015 at 13:26:32 UTC, Suliman wrote:
So what what would call at first ?
The operating system starts the program
Then the extern(C) int main() gets called.
Then the _Dmain gets called.
I know there is mutable variables, but what is a mutable method?
Error message says mutable method
project.mariadb.connector.ver2p1.resultset.ResultSetColumn.info
is not callable using a const object.
On Friday, 22 May 2015 at 12:12:46 UTC, tcak wrote:
I know there is mutable variables, but what is a mutable method?
Error message says mutable method
project.mariadb.connector.ver2p1.resultset.ResultSetColumn.info
is not callable using a const object.
The method that can change the state
On 5/22/15 8:12 AM, tcak wrote:
I know there is mutable variables, but what is a mutable method?
Error message says mutable method
project.mariadb.connector.ver2p1.resultset.ResultSetColumn.info is not
callable using a const object.
English grammar nit: I would say mutating instead of
On Friday, May 22, 2015 12:12:45 tcak via Digitalmars-d-learn wrote:
I know there is mutable variables, but what is a mutable method?
Error message says mutable method
project.mariadb.connector.ver2p1.resultset.ResultSetColumn.info
is not callable using a const object.
It's a method / member
On 5/22/15 1:49 AM, weaselcat wrote:
On Friday, 22 May 2015 at 05:47:28 UTC, Mike Parker wrote:
I've always used opSlice to produce empty slices, but having recently
read the documentation at [1], I see this:
To overload a[], simply define opIndex with no parameters:
And no mention that
On 5/22/15 2:36 AM, Suliman wrote:
On SO[1] I got next answer:
What happens when you launch a D application ? The entry point is a C
main inside the runtime, which initialize it (the runtime), including
module constructor, run the unittest (if you've compiled with
-unittest), then call your
On Friday, 22 May 2015 at 10:54:36 UTC, Stefan Frijters wrote:
I have a code which does a lot of work on 2D/3D arrays, for
which I use the 2.066 multidimensional slicing syntax through a
fork of the Unstandard package [1].
Many times the order of operations doesn't matter and I thought
I would
There's very little writing about D's core.atomics(TDPL seems to
very barely cover them, I assume it's because it's aging compared
to the library.)
Is it safe to assume that they behave similarly to C++11's
atomics?
31 matches
Mail list logo