On 2013-09-03 23:32, Adam D. Ruppe wrote:
How do I keep missing these new std.traits things? Very nice.
Because they just magically shows up :)
--
/Jacob Carlborg
04.09.2013 0:58, Ali Çehreli пишет:
One way is, the child can send a special message (even the exception
itself) when it terminates:
// ... at the worker ...
try {
// ...
} catch (shared(Exception) exc) {
owner.send(exc
If a range struct (Range) is defined inside another struct (Test), how
can the constness or mutability of Test be attributed to the return type
of Range.front? I'm running into this problem because I need the range to
be iterated, but I need the pointer in T to be marked const when
appropriate.
H. S. Teoh:
I filed a new issue just in case:
http://d.puremagic.com/issues/show_bug.cgi?id=10960
Thank you. But the idea of stripping away the const from copied
values misses my main point, so I have added a note there.
Bye,
bearophile
On 09/03/2013 03:22 PM, bearophile wrote:
> Currently this code doesn't work, because the B array is const, so B[i]
> is const:
>
>
> import std.algorithm: schwartzSort;
> void main() {
> auto A = [0, 1, 2];
> const B = [10, -20, 30];
> schwartzSort!(i => B[i])(A);
The return type
On Tue, Sep 03, 2013 at 03:57:09PM -0700, Ali Çehreli wrote:
> On 09/03/2013 03:22 PM, bearophile wrote:
>
> > Currently this code doesn't work, because the B array is const, so B[i]
> > is const:
> >
> >
> > import std.algorithm: schwartzSort;
> > void main() {
> > auto A = [0, 1, 2];
> >
Currently this code doesn't work, because the B array is const,
so B[i] is const:
import std.algorithm: schwartzSort;
void main() {
auto A = [0, 1, 2];
const B = [10, -20, 30];
schwartzSort!(i => B[i])(A);
}
dmd gives:
...\dmd2\src\phobos\std\conv.d(3734): Error: static assert
On Tuesday, 3 September 2013 at 21:20:04 UTC, Andrej Mitrovic
wrote:
foreach (id; ParameterIdentifierTuple!func)
How do I keep missing these new std.traits things? Very nice.
Carl Sturtivant wrote:
> is supposed to transform one delegate into another
Then please declare the template parameters to be delegates:
U muddle( T, U)( T f) {
uint g( int fp){
return cast(uint)( 5* f( fp));
}
auto gP= &g;
return gP;
}
unittest {
On 9/3/13, Gary Willoughby wrote:
> Using traits how do i get a methods's parameters as a string? Say
> i have the following method:
Here's a first attempt:
-
import std.range;
import std.string;
import std.stdio;
import std.traits;
class C
{
void setAge(int age, int)
{
}
}
tem
On Tuesday, 3 September 2013 at 21:01:27 UTC, Gary Willoughby
wrote:
Using traits how do i get a methods's parameters as a string?
Say i have the following method:
Use typeof(setAge).stringof to get something you can then parse
to fet the names.
My web.d has a function to do it:
https://git
Using traits how do i get a methods's parameters as a string? Say
i have the following method:
...
public void setAge(int age)
{
this._age = age;
}
...
I want a string that is: "(int age)" or how ever many params
there are. The nearest i got was using this code:
ParameterTypeTuple!(__tra
On 09/03/2013 09:26 AM, Alexandr Druzhinin wrote:
> OwnerFailed exception catching like TDPL says, but std.concurrency has
> no such symbol.
These are the ones that I am aware of at this time:
MessageMismatch
OwnerTerminated
LinkTerminated
MailboxFull
PriorityMessageException
> So, s
Carl Sturtivant wrote:
> Writing muddle!(int,int)
[...]
> gives the same error message.
Not entirely true:
template muddle( T, U...){
alias T delegate( U) Dptr;
auto muddle1( T, U...)( Dptr f) {
return f; //or make another delegate in real code
}
alias muddle1!( T, U) muddle;
}
Hello
I try to get known if daughter thread finished its work using
OwnerFailed exception catching like TDPL says, but std.concurrency has
no such symbol. So, something changed. Can somebody help me with this
case - finding if a child thread finished/terminated?
I know about spawnLinked, but I
On Tuesday, 3 September 2013 at 13:42:44 UTC, Manfred Nowak wrote:
Carl Sturtivant wrote:
No it isn't according to dmd.
dmd does not express this.
according to
p1.d(15): Error: [...]
dmd "cannot deduce" that `Dptr!(T, U)' might be equal to
`int delegate(int)'
-manfred
I understood that.
Carl Sturtivant wrote:
> How do I fix this?
maybe it is currently not fixable because of restrictions in the deduction
algorithm.
Obviously the deduction works if the instantion of the template is replaced
by a symbol by `alias T delegate( U) Dptr;' or similar.
-manfred
Carl Sturtivant wrote:
> No it isn't according to dmd.
dmd does not express this.
according to
> p1.d(15): Error: [...]
dmd "cannot deduce" that `Dptr!(T, U)' might be equal to
`int delegate(int)'
-manfred
I'm confused as to what you're trying to do... your example
code is equivalent to
import std.stdio;
int x = 3;
int scale( int s) { return x * s; }
auto f = &scale;
writeln( f(7) );
No it isn't according to dmd.
My code is a minimal piece that produces the same error as some
real
On Tuesday, 3 September 2013 at 03:49:52 UTC, Carl Sturtivant
wrote:
template Dptr( T, U...) {
alias T delegate( U args) Dptr;
}
Dptr!(T,U) muddle( T, U...)( Dptr!(T,U) f) {
return f; //or make another delegate in real code
}
unittest {
import std.stdio;
int x
Am 02.09.2013 15:39, schrieb Artur Skawina:
this(this) { jump.ptr = &this; }
Just a warning: This can still easily crash due to D's struct move
semantics. Structs are moved around sometimes without any postblit
constructor or destructor being called, so fixing self-references like
thi
I wouldn't mind so much if just "regularly" compiling, just do
each file in turn. The problem is this how rdmd calls dmd and
then things don't work as they should.
On Saturday, 31 August 2013 at 12:06:00 UTC, Dicebot wrote:
On Saturday, 31 August 2013 at 09:29:16 UTC, Atila Neves wrote:
How
On 2013-09-02 17:00, Joseph Rushton Wakeling wrote:
P.S. If I don't find a handy inheritance-based way to do this, what I'll
probably do is something along the lines of,
class MyFakeSubclass
{
MyBaseClass base;
// ... extra data ...
// ... manually-written
23 matches
Mail list logo