On Sunday, 8 July 2018 at 02:10:12 UTC, Simen Kjærås wrote:
Also, you should probably use CommonType!A for the type of
temp, since an int can't hold all the possible values of a long
or ulong (or even uint), and you'll thus get unexpected results
with large numbers.
--
Simen
I see, thanks,
On Sunday, 8 July 2018 at 00:52:41 UTC, Flaze07 wrote:
On Sunday, 8 July 2018 at 00:46:13 UTC, Flaze07 wrote:
I want to force the variadic templates's type to be of certain
types, I thought doing this would work
auto sum( A... )( A a ) if( isIntegral!( typeid( a[ 0 ] ) ) )
{
int temp;
f
On Sunday, 8 July 2018 at 00:46:13 UTC, Flaze07 wrote:
I want to force the variadic templates's type to be of certain
types, I thought doing this would work
auto sum( A... )( A a ) if( isIntegral!( typeid( a[ 0 ] ) ) )
{
int temp;
foreach( t ; a )
{
temp += t;
}
retur
I want to force the variadic templates's type to be of certain
types, I thought doing this would work
auto sum( A... )( A a ) if( isIntegral!( typeid( a[ 0 ] ) ) )
{
int temp;
foreach( t ; a )
{
temp += t;
}
return temp;
}
but it gives out error
( note : I want all the
On Friday, 6 July 2018 at 23:54:35 UTC, SrMordred wrote:
Well, since its VS 2017 installer, eventually I hit all the
components needed to install it properly. Now its working.
Thanks 0xEAB for the tip about the Windows SDK too :)
No problem :)
On Thursday, 5 July 2018 at 08:42:39 UTC, drug wrote:
There were several attempts to make Qt binding for dlang ...
QtE 5 works great on Win32/64, Linux 32/64 and Mac OS x 64. The
main difference is that Qt5 uses a set of pre-defined slots and
signals rather than creating them using a MOC or c
On Saturday, 7 July 2018 at 15:25:51 UTC, vino.B wrote:
Hi All,
If we replace the statement as args[$ -1] the program works
are expected, if we apply the same logic in different approach
it does not work, in the below code if we command the first
block "if (fnID == "ListFilesNames") {} " t
On Saturday, 7 July 2018 at 12:13:21 UTC, Alex wrote:
On Saturday, 7 July 2018 at 11:22:38 UTC, Timoses wrote:
Aw, got it. So args is actually a tuple type where accessing
beyond the defined tuple (T) is invalid?
auto a = [1, 2, 4];
// works
pragma(msg, typeof(a[3]));
On Saturday, 7 July 2018 at 12:54:03 UTC, kdevel wrote:
On Saturday, 7 July 2018 at 12:46:08 UTC, rikki cattermole
wrote:
On 08/07/2018 12:40 AM, kdevel wrote:
Interesting alternative
That was not an alternative.
That is what your code was doing.
What my original code was supposed to do. Bu
On 08/07/2018 12:54 AM, kdevel wrote:
On Saturday, 7 July 2018 at 12:46:08 UTC, rikki cattermole wrote:
On 08/07/2018 12:40 AM, kdevel wrote:
Interesting alternative
That was not an alternative.
That is what your code was doing.
What my original code was supposed to do. But it did not compi
On Saturday, 7 July 2018 at 12:46:08 UTC, rikki cattermole wrote:
On 08/07/2018 12:40 AM, kdevel wrote:
Interesting alternative
That was not an alternative.
That is what your code was doing.
What my original code was supposed to do. But it did not compile.
Error: array index [0] is outsi
On 08/07/2018 12:40 AM, kdevel wrote:
Interesting alternative
That was not an alternative.
That is what your code was doing.
On Saturday, 7 July 2018 at 11:56:40 UTC, rikki cattermole wrote:
On 07/07/2018 11:44 PM, kdevel wrote:
On Saturday, 7 July 2018 at 11:29:35 UTC, rikki cattermole
wrote:
static if (args.length == 0)
return;
else {
writeln (args [0]);
return bar (args [1 .. $]
On Saturday, 7 July 2018 at 11:22:38 UTC, Timoses wrote:
Aw, got it. So args is actually a tuple type where accessing
beyond the defined tuple (T) is invalid?
auto a = [1, 2, 4];
// works
pragma(msg, typeof(a[3]));
auto t = tuple(3, 4, 5.3);
// ERROR:
// p
On 07/07/2018 11:44 PM, kdevel wrote:
On Saturday, 7 July 2018 at 11:29:35 UTC, rikki cattermole wrote:
static if (args.length == 0)
return;
else {
writeln (args [0]);
return bar (args [1 .. $]);
}
That's not guard clause style [1][2].
[1]
https://refact
On Saturday, 7 July 2018 at 11:29:35 UTC, rikki cattermole wrote:
static if (args.length == 0)
return;
else {
writeln (args [0]);
return bar (args [1 .. $]);
}
That's not guard clause style [1][2].
[1]
https://refactoring.com/catalog/replaceNestedConditio
On 07/07/2018 11:28 PM, kdevel wrote:
It appears not to be possible to use static if in "guard clause style"
as in
void bar (T ...) (T args)
{
static if (args.length == 0)
return;
else {
writeln (args [0]);
return bar (args [1 .. $]);
}
}
It appears not to be possible to use static if in "guard clause
style" as in
void bar (T ...) (T args)
{
static if (args.length == 0)
return;
writeln (args [0]);
return bar (args [1 .. $]);
}
Is this intended?
On Saturday, 7 July 2018 at 08:35:27 UTC, Alex wrote:
On Saturday, 7 July 2018 at 08:24:21 UTC, Timoses wrote:
Interesting.. Looks like the compiler does some boundschecking
during compile time. You could circumvent this:
void process(T ...)(string ID, T args) {
if (ID == "I1") {
On Saturday, 7 July 2018 at 08:24:21 UTC, Timoses wrote:
Interesting.. Looks like the compiler does some boundschecking
during compile time. You could circumvent this:
void process(T ...)(string ID, T args) {
if (ID == "I1") { writeln(args.length, "\t", args[0]); }
static i
On Saturday, 7 July 2018 at 08:09:51 UTC, vino.B wrote:
Hi All,
Request you help, on the below code
import std.stdio: writeln;
void process(T ...)(string ID, T args) {
if (ID == "I1") { writeln(args.length, "\t", args[0]); }
else if (ID == "I2") { writeln(args.length, "\t", args[1]);}
}
voi
On Saturday, 7 July 2018 at 08:09:51 UTC, vino.B wrote:
Hi All,
Request you help, on the below code
import std.stdio: writeln;
void process(T ...)(string ID, T args) {
if (ID == "I1") { writeln(args.length, "\t", args[0]); }
else if (ID == "I2") { writeln(args.length, "\t", args[1]);}
}
voi
On Saturday, 7 July 2018 at 08:09:51 UTC, vino.B wrote:
Hi All,
Request you help, on the below code
import std.stdio: writeln;
void process(T ...)(string ID, T args) {
if (ID == "I1") { writeln(args.length, "\t", args[0]); }
else if (ID == "I2") { writeln(args.length, "\t", args[1]);}
}
voi
Hi All,
Request you help, on the below code
import std.stdio: writeln;
void process(T ...)(string ID, T args) {
if (ID == "I1") { writeln(args.length, "\t", args[0]); }
else if (ID == "I2") { writeln(args.length, "\t", args[1]);}
}
void main() {
string S1 = "Test1", S2 = "Test2", ID1 = "I1",
24 matches
Mail list logo