On Wed, 16 Nov 2011 18:25:48 -0500, Timon Gehr timon.g...@gmx.ch 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
On Wed, 16 Nov 2011 17:39:16 -0500, Timon Gehr timon.g...@gmx.ch wrote:
On 11/16/2011 10:56 PM, Steven Schveighoffer wrote:
On Wed, 16 Nov 2011 16:16:48 -0500, Timon Gehr timon.g...@gmx.ch
wrote:
On 11/16/2011 09:00 PM, Steven Schveighoffer wrote:
On Wed, 16 Nov 2011 14:26:57 -0500, Timon
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
On 11/17/2011 03:19 PM, Steven Schveighoffer wrote:
On Wed, 16 Nov 2011 17:39:16 -0500, Timon Gehr timon.g...@gmx.ch wrote:
On 11/16/2011 10:56 PM, Steven Schveighoffer wrote:
On Wed, 16 Nov 2011 16:16:48 -0500, Timon Gehr timon.g...@gmx.ch
wrote:
On 11/16/2011 09:00 PM, Steven
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,
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: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
On Thu, 17 Nov 2011 12:31:58 -0500, Timon Gehr timon.g...@gmx.ch 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
On 11/17/2011 07:23 PM, Steven Schveighoffer wrote:
On Thu, 17 Nov 2011 12:31:58 -0500, Timon Gehr timon.g...@gmx.ch 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
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);
Ah, I should have read the following parts where it describes thread
termination, in TDPL. Woops.
On 11/17/11, Andrej Mitrovic andrej.mitrov...@gmail.com wrote:
This is an example from TDPL:
import std.concurrency;
import std.exception;
import std.stdio;
void main()
{
auto low = 0;
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 thread: , i);
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
Ok, tk u all.
I guess this is a very poor approach if we are looking for
performance
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
15 matches
Mail list logo