Having a template:
struct SomeStruct(int size)
{
}
Is there any language trait returning the value of size template
parameter for the template instantiation SomeStruct!10?
In fact, I'm interested in an eponymous template to test if some
type is a template inttantation for SomeStruct(int
On Tuesday, 29 September 2015 at 06:08:03 UTC, Cauterite wrote:
On Tuesday, 29 September 2015 at 03:31:44 UTC, Nicholas Wilson
wrote:
so I have a bunch of enums (0 .. n) that i also want to
represent as flags ( 1 << n foreach n ). Is there anyway to do
this other than a string mixin?
You
On Tuesday, 29 September 2015 at 03:31:44 UTC, Nicholas Wilson
wrote:
so I have a bunch of enums (0 .. n) that i also want to
represent as flags ( 1 << n foreach n ). Is there anyway to do
this other than a string mixin?
You could cheat with operator overloading:
enum blah {
On Tuesday, 29 September 2015 at 03:31:44 UTC, Nicholas Wilson
wrote:
so I have a bunch of enums (0 .. n) that i also want to
represent as flags ( 1 << n foreach n ). Is there anyway to do
this other than a string mixin?
use like:
enum blah
{
foo,
bar,
baz,
}
alias blahFlags =
On Tuesday, 29 September 2015 at 09:18:52 UTC, John Colvin wrote:
On Tuesday, 29 September 2015 at 03:31:44 UTC, Nicholas Wilson
wrote:
so I have a bunch of enums (0 .. n) that i also want to
represent as flags ( 1 << n foreach n ). Is there anyway to do
this other than a string mixin?
use
On Tuesday, 29 September 2015 at 09:15:29 UTC, ponce wrote:
On Monday, 28 September 2015 at 16:01:54 UTC, Sebastiaan Koppe
wrote:
I could not find out which redistributable I had to install
(what version of VS did you have installed / on what version
of windows are you?). I decided to install
On Tuesday, 29 September 2015 at 09:53:39 UTC, Kagamin wrote:
On Tuesday, 29 September 2015 at 09:11:15 UTC, John Colvin
wrote:
Welcome to the weird and wonderful work of
http://dlang.org/expression.html#IsExpression
No, use template pattern matching instead:
struct A(int s){}
template
On Tuesday, 29 September 2015 at 07:50:42 UTC, rumbu wrote:
Having a template:
struct SomeStruct(int size)
{
}
Is there any language trait returning the value of size
template parameter for the template instantiation SomeStruct!10?
Something like this is ok?
struct SomeStruct(int size)
{
On Tuesday, 29 September 2015 at 03:31:44 UTC, Nicholas Wilson
wrote:
so I have a bunch of enums (0 .. n) that i also want to
represent as flags ( 1 << n foreach n ). Is there anyway to do
this other than a string mixin?
use like:
enum blah
{
foo,
bar,
baz,
}
alias blahFlags =
On Monday, 28 September 2015 at 16:01:54 UTC, Sebastiaan Koppe
wrote:
I could not find out which redistributable I had to install
(what version of VS did you have installed / on what version of
windows are you?). I decided to install them all, but couldn't
install the one for 2015 (due to
On Monday, 28 September 2015 at 16:36:47 UTC, ponce wrote:
OK, but why does that need to happen? I don't get why does
linking with MS linker implies a runtime dependency.
I thought we would be left out of these sort of problems when
using D :(
About universal CRT:
On Tuesday, 29 September 2015 at 08:44:03 UTC, Andrea Fontana
wrote:
On Tuesday, 29 September 2015 at 07:50:42 UTC, rumbu wrote:
Having a template:
struct SomeStruct(int size)
{
}
Is there any language trait returning the value of size
template parameter for the template instantiation
On Tuesday, 29 September 2015 at 09:53:39 UTC, Kagamin wrote:
On Tuesday, 29 September 2015 at 09:11:15 UTC, John Colvin
wrote:
Welcome to the weird and wonderful work of
http://dlang.org/expression.html#IsExpression
No, use template pattern matching instead:
struct A(int s){}
template
On Tuesday, 29 September 2015 at 07:50:42 UTC, rumbu wrote:
Having a template:
struct SomeStruct(int size)
{
}
Is there any language trait returning the value of size
template parameter for the template instantiation SomeStruct!10?
This should do it (untested):
template SomeStructSize(T)
On Tue, 2015-09-29 at 03:05 +, bitwise via Digitalmars-d-learn
wrote:
> On Monday, 28 September 2015 at 11:47:38 UTC, Russel Winder wrote:
> > I hadn't answered as I do not have answers to the questions you
> > ask. My reason: people should not be doing their codes using
> > these low-level
On Tuesday, 29 September 2015 at 09:44:58 UTC, Sebastiaan Koppe
wrote:
On Tuesday, 29 September 2015 at 09:15:29 UTC, ponce wrote:
On Monday, 28 September 2015 at 16:01:54 UTC, Sebastiaan Koppe
wrote:
I could not find out which redistributable I had to install
(what version of VS did you have
On Saturday, 26 September 2015 at 10:10:39 UTC, Alexandru
Ermicioi wrote:
Suppose we have, two modules:
module testOne;
[...]
So, is this behavior correct?
If yes, then why?
On Tuesday, 29 September 2015 at 09:11:15 UTC, John Colvin wrote:
Welcome to the weird and wonderful work of
http://dlang.org/expression.html#IsExpression
No, use template pattern matching instead:
struct A(int s){}
template B(T:A!s, int s){ enum B=s; }
static assert(B!(A!4)==4);
Another question on move semantics from the cheap seats...
See my code here: http://dpaste.dzfl.pl/995c5af59dd6
There are indeed three questions, all marked in the code, so the
rest of the text here is maybe redundant... but just in case and
for summary:
I try to model a inner class of some
On 09/29/15 12:13, rumbu via Digitalmars-d-learn wrote:
> On Tuesday, 29 September 2015 at 09:53:39 UTC, Kagamin wrote:
>> On Tuesday, 29 September 2015 at 09:11:15 UTC, John Colvin wrote:
>>> Welcome to the weird and wonderful work of
>>> http://dlang.org/expression.html#IsExpression
>>
>> No,
On Tuesday, 29 September 2015 at 21:04:06 UTC, Wulfrick wrote:
Is there an interval arithmetic library in D? I couldn’t find
one.
None I am aware of.
In case I had to write my own, I understand that the IEEE
standard floating point arithmetic provides operations for
rounding up or down
On 9/29/15 4:38 PM, Johannes Pfau wrote:
Am Tue, 29 Sep 2015 15:10:58 -0400
schrieb Steven Schveighoffer :
3) Why do I have to pass a "Mutex" to "Condition"? Why can't I just
pass an "Object"?
An object that implements the Monitor interface may not actually be a
mutex.
Thank you very much for the comments.
It is much clearer now. The .outer link is just a shortcut, which
does not mean I don't have to reset it, where I have to.
So... essentially, my expectation WAS to subjective and I have to
separate better, what is the part of the model in my head and
what
Am Tue, 29 Sep 2015 15:10:58 -0400
schrieb Steven Schveighoffer :
>
> > 3) Why do I have to pass a "Mutex" to "Condition"? Why can't I just
> > pass an "Object"?
>
> An object that implements the Monitor interface may not actually be a
> mutex. For example, a
Is there an interval arithmetic library in D? I couldn’t find one.
In case I had to write my own, I understand that the IEEE
standard floating point arithmetic provides operations for
rounding up or down certain operations like summing, subtracting,
etc. (thus overriding the default behavior
On Tuesday 29 September 2015 16:38, Alex wrote:
> Another question on move semantics from the cheap seats...
>
> See my code here: http://dpaste.dzfl.pl/995c5af59dd6
[...]
> The first (minor) question is:
> I have to initialize some dummy inner objects, before I can apply
> the move action. Is
On 09/29/2015 07:38 AM, Alex wrote:
> See my code here: http://dpaste.dzfl.pl/995c5af59dd6
> Following my code, the inner object I moved does not disappear from the
> array in the source outer object. Why?
> After I moved the inner object to the new outer object, the pointer to
> the outer
On 9/25/15 11:19 AM, bitwise wrote:
Hey, I've got a few questions if anybody's got a minute.
I'm trying to wrap my head around the threading situation in D. So far,
things seem to be working as expected, but I want to verify my solutions.
1) Are the following two snippets exactly
28 matches
Mail list logo