On Thursday, November 17, 2011 14:41 RenatoL wrote:
> Ok, tk u all.
> I guess this is a very poor approach if we are looking for
> performance
Mixing types like that in an array is not a normal thing to do. However, if
you're looking to hold a specific number of items of diverse types
(particula
Ok, tk u all.
I guess this is a very poor approach if we are looking for
performance
I've had this bug recently:
auto workTid = spawn(&work);
setMaxMailboxSize(thisTid, 1, OnCrowding.throwException);
IOW, I've passed 'thisTid' instead of 'workTid' to the call.
Is there any reason why had to be a global function? Tid has a private
MessageBox which has the setMaxMsgs method. We ca
On Thursday, November 17, 2011 11:56 Andrej Mitrovic wrote:
> This is an example from TDPL:
>
> import std.concurrency;
> import std.exception;
> import std.stdio;
>
> void main()
> {
> auto low = 0;
> auto high = 100;
> auto tid = spawn(&writer);
>
> foreach (i; low .. high)
> {
> writeln("Main
Ah, I should have read the following parts where it describes thread
termination, in TDPL. Woops.
On 11/17/11, Andrej Mitrovic wrote:
> This is an example from TDPL:
>
> import std.concurrency;
> import std.exception;
> import std.stdio;
>
> void main()
> {
> auto low = 0;
> auto high = 1
This is an example from TDPL:
import std.concurrency;
import std.exception;
import std.stdio;
void main()
{
auto low = 0;
auto high = 100;
auto tid = spawn(&writer);
foreach (i; low .. high)
{
writeln("Main thread: ", i);
tid.send(thisTid, i);
enforce(
On 11/17/2011 07:23 PM, Steven Schveighoffer wrote:
On Thu, 17 Nov 2011 12:31:58 -0500, Timon Gehr wrote:
On 11/17/2011 03:19 PM, Steven Schveighoffer wrote:
What does writelnInferConst!T do? I'm afraid I'm not getting what you
are saying.
I was thinking writeln should do this:
void writ
On Thu, 17 Nov 2011 12:31:58 -0500, Timon Gehr wrote:
On 11/17/2011 03:19 PM, Steven Schveighoffer wrote:
What does writelnInferConst!T do? I'm afraid I'm not getting what you
are saying.
I was thinking writeln should do this:
void writeln(T...)(const T args) {...}
As you pointed out, t
On 11/17/2011 06:41 PM, Timon Gehr wrote:
On 11/17/2011 06:12 PM, Tobias Pankrath wrote:
It would be cool, if the following would be possible.
immutable string MemberID = "M";
struct A {}
struct B {
alias A M;
}
template Member(T)
{
static if(__traits(hasMember, T, MemberID))
{
alias __tr
> This helps a lot with the current state of affairs:
>
> template ID(alias x){alias x ID;}
>
> It will even allow funny things like this:
>
> alias ID!((a,b){return a+b;}) add;
>
> static assert(add(1,2) == 3);
Nice to know, thanks!
On 11/17/2011 06:12 PM, Tobias Pankrath wrote:
It would be cool, if the following would be possible.
immutable string MemberID = "M";
struct A {}
struct B {
alias A M;
}
template Member(T)
{
static if(__traits(hasMember, T, MemberID))
{
alias __traits(getMember, T,
On 11/17/2011 03:19 PM, Steven Schveighoffer wrote:
On Wed, 16 Nov 2011 17:39:16 -0500, Timon Gehr wrote:
On 11/16/2011 10:56 PM, Steven Schveighoffer wrote:
On Wed, 16 Nov 2011 16:16:48 -0500, Timon Gehr
wrote:
On 11/16/2011 09:00 PM, Steven Schveighoffer wrote:
On Wed, 16 Nov 2011 14:26
It would be cool, if the following would be possible.
immutable string MemberID = "M";
struct A {}
struct B {
alias A M;
}
template Member(T)
{
static if(__traits(hasMember, T, MemberID))
{
alias __traits(getMember, T, MemberID) Member;
}
else
alias TypeT
On Wed, 16 Nov 2011 18:25:48 -0500, Timon Gehr wrote:
On 11/16/2011 11:39 PM, Timon Gehr wrote:
I think this is a better solution:
void foo2(T: ParameterTypeTuple!foo[0])(T t){foo(t);}
Then it is just a matter of applying proper value range propagation for
IFTY:
void bar(T: short)(T t){...}
On Wed, 16 Nov 2011 17:39:16 -0500, Timon Gehr wrote:
On 11/16/2011 10:56 PM, Steven Schveighoffer wrote:
On Wed, 16 Nov 2011 16:16:48 -0500, Timon Gehr
wrote:
On 11/16/2011 09:00 PM, Steven Schveighoffer wrote:
On Wed, 16 Nov 2011 14:26:57 -0500, Timon Gehr
wrote:
On 11/16/2011 02:22
15 matches
Mail list logo