Template parameter deduction in partially specialized template
fails:
---
enum Bar{b,a,r}
void foo(Bar bar, T)(T t){}
alias foob(T) = foo!(Bar.b, T);
void main()
{
foo!(Bar.b)(8);
foob(8); // autsch
}
---
It looks like a bug, doesn't it ?
On Friday, 6 November 2015 at 08:48:38 UTC, user123456789abcABC
wrote:
Template parameter deduction in partially specialized template
fails:
---
enum Bar{b,a,r}
void foo(Bar bar, T)(T t){}
alias foob(T) = foo!(Bar.b, T);
void main()
{
foo!(Bar.b)(8);
foob(8); // autsch
}
---
It looks
On Thursday, 5 November 2015 at 17:40:12 UTC, bearophile wrote:
Namal:
Hello I am trying to convert BigInt to string like that while
trying to sort it:
void main() {
import std.stdio, std.algorithm, std.conv, std.bigint,
std.string;
auto n = 17.BigInt ^^ 179;
n.text.dup.represe
On Friday, 6 November 2015 at 04:34:28 UTC, TheFlyingFiddle wrote:
On Friday, 6 November 2015 at 03:59:07 UTC, Charles wrote:
Is it possible to have unittest blocks if I'm compiling a
library?
I've tried having this:
test.d:
class Classy {
unittest { assert(0, "failed test"); }
On Friday, 6 November 2015 at 11:37:22 UTC, Marc Schütz wrote:
Ok, benchA and benchB have the same assembler code generated.
However, I _can_ reproduce the slowdown albeit on average only
20%-40%, not a factor of 10.
Forgot to add that this is on Linux x86_64, so that probably
explains the di
Ok, benchA and benchB have the same assembler code generated.
However, I _can_ reproduce the slowdown albeit on average only
20%-40%, not a factor of 10.
It turns out that it's always the first tested function that's
slower. You can test this by switching benchA and benchB in the
call to benc
On Friday, 6 November 2015 at 10:00:23 UTC, Namal wrote:
On Thursday, 5 November 2015 at 17:40:12 UTC, bearophile wrote:
Namal:
Hello I am trying to convert BigInt to string like that while
trying to sort it:
void main() {
import std.stdio, std.algorithm, std.conv, std.bigint,
std.strin
I wrote Application in D. That use next components:
"colorize": ">=1.0.5",
"ddbc": ">=0.2.11",
"vibe-d": "~>0.7.26"
On Windows 7 it's work fine. On Windows 10 (clean install) it's
do not start and require MSVCR120.dll And I can't understand what
component is pulling this lib as dependence. Wha
MSVCR is a C runtime. On Linux it will depend on a C runtime too.
On Thursday, 5 November 2015 at 13:08:20 UTC, Adam D. Ruppe wrote:
On Thursday, 5 November 2015 at 10:04:02 UTC, Andrea Fontana
wrote:
Anyway: are duplicated keys on declaration allowed?
They shouldn't be...
Why? I'll admit it is something I've never even thought of using,
but every languag
On Friday, 6 November 2015 at 14:28:53 UTC, cym13 wrote:
auto aa = ["a":10, "b", 42, "a":20];
This should readauto aa = ["a":10, "b":42, "a":20]; of
course.
hi,
i like to use a window gui library and i think i found a working
one.
https://github.com/FrankLIKE/dfl2 - works with x64
the problem is, that with DMD 2.069.0, VS2015 and visualD the
trick of using "-L/SUBSYSTEM:windows,6.00
-L/ENTRY:mainCRTStartup" does not suppress the console window
On Friday, 6 November 2015 at 13:50:56 UTC, Kagamin wrote:
MSVCR is a C runtime. On Linux it will depend on a C runtime
too.
But which part of my App depend on C runtime?
On Friday, 6 November 2015 at 16:21:35 UTC, Suliman wrote:
On Friday, 6 November 2015 at 13:50:56 UTC, Kagamin wrote:
MSVCR is a C runtime. On Linux it will depend on a C runtime
too.
But which part of my App depend on C runtime?
All of it. Phobos and druntime use the C runtime, that means t
On Friday, 6 November 2015 at 16:21:35 UTC, Suliman wrote:
On Friday, 6 November 2015 at 13:50:56 UTC, Kagamin wrote:
MSVCR is a C runtime. On Linux it will depend on a C runtime
too.
But which part of my App depend on C runtime?
I have an early draft to explain the libraries here:
https://b
On Friday, 6 November 2015 at 11:38:29 UTC, Marc Schütz wrote:
On Friday, 6 November 2015 at 11:37:22 UTC, Marc Schütz wrote:
Ok, benchA and benchB have the same assembler code generated.
However, I _can_ reproduce the slowdown albeit on average only
20%-40%, not a factor of 10.
Forgot to add
Hello,
I have read various things about struct constructors,
specifically 0 argument constructors, and using opCall and
@disable this(); which no longer seems to work.
What I am after I think is the behavior of C++'s structs on the
stack, namely for some or all of these uses at a given time:
On Friday, 6 November 2015 at 17:34:29 UTC, Spacen Jasset wrote:
Hello,
I have read various things about struct constructors,
specifically 0 argument constructors, and using opCall and
@disable this(); which no longer seems to work.
What I am after I think is the behavior of C++'s structs on
I did some testing on Linux and Windows.
I ran the code with ten times the iterations, and found the
results consistent with what has previously been observed in this
thread.
The code seems to run just fine on Linux, but is slowed down 10x
on Windows x86.
Windows (32-bit)
rdmd bug.d -inline
On Friday, 6 November 2015 at 13:16:46 UTC, Suliman wrote:
On Windows 7 it's work fine. On Windows 10 (clean install) it's
do not start and require MSVCR120.dll
D doesn't make particularly heavy use of the C runtime, so
there's a good chance you can link against a different C runtime
DLL — pr
On Friday, 6 November 2015 at 13:16:46 UTC, Suliman wrote:
I wrote Application in D. That use next components:
"colorize": ">=1.0.5",
"ddbc": ">=0.2.11",
"vibe-d": "~>0.7.26"
On Windows 7 it's work fine. On Windows 10 (clean install) it's
do not start and require MSVCR120.dll And I can't under
On Friday, 6 November 2015 at 17:50:17 UTC, Atila Neves wrote:
On Friday, 6 November 2015 at 17:34:29 UTC, Spacen Jasset wrote:
Hello,
I have read various things about struct constructors,
specifically 0 argument constructors, and using opCall and
@disable this(); which no longer seems to wor
On Friday, 6 November 2015 at 15:52:10 UTC, johann wrote:
hi,
i like to use a window gui library and i think i found a
working one.
https://github.com/FrankLIKE/dfl2 - works with x64
the problem is, that with DMD 2.069.0, VS2015 and visualD the
trick of using "-L/SUBSYSTEM:windows,6.00
-L/
Consider this:
[code]
import std.stdio, std.utf, std.exception;
void do_decode(string txt)
{
try
{
size_t idx;
writeln("decode ", txt);
for (size_t i = 0; i < txt.length; i++)
{
dchar dc = std.utf.decode(txt[i..i+1], idx);
writeln("
Sorry, I mixed up the line numbers from dmd 2.068.2 and dmd
2.069.0.
The correct line numbers for dmd 2.069.0 are:
Attempted to decode past the end of a string (at index 1)
file=D:\dmd2\windows\bin\..\..\src\phobos\std\utf.d line=1281
and
core.exception.RangeError@std\utf.d(1278): Range viol
On Friday, 6 November 2015 at 19:26:50 UTC, HeiHon wrote:
Consider this:
[code]
import std.stdio, std.utf, std.exception;
void do_decode(string txt)
{
try
{
size_t idx;
writeln("decode ", txt);
for (size_t i = 0; i < txt.length; i++)
{
dchar d
On Friday, 6 November 2015 at 19:26:50 UTC, HeiHon wrote:
Am I using std.utf.decode wrongly or is it buggy?
It's obviously used wrongly, try this instead:
import std.utf, std.stdio;
---
dstring do_decode(string txt)
{
dstring result;
try
{
size_t idx;
writeln("deco
Sorry, the forum as stripped my answer. Here is the full version:
On Friday, 6 November 2015 at 19:26:50 UTC, HeiHon wrote:
Am I using std.utf.decode wrongly or is it buggy?
It's obviously used wrongly, try this instead:
import std.utf, std.stdio;
---
dstring do_decode(string txt)
{
dstr
On Friday, 6 November 2015 at 15:52:10 UTC, johann wrote:
hi,
i like to use a window gui library and i think i found a
working one.
https://github.com/FrankLIKE/dfl2 - works with x64
the problem is, that with DMD 2.069.0, VS2015 and visualD the
trick of using "-L/SUBSYSTEM:windows,6.00
-L/
On Friday, 6 November 2015 at 17:55:47 UTC, arGus wrote:
I did some testing on Linux and Windows.
I ran the code with ten times the iterations, and found the
results consistent with what has previously been observed in
this thread.
The code seems to run just fine on Linux, but is slowed down
1
On Friday, 6 November 2015 at 21:02:59 UTC, John Chapman wrote:
On Friday, 6 November 2015 at 15:52:10 UTC, johann wrote:
hi,
i like to use a window gui library and i think i found a
working one.
https://github.com/FrankLIKE/dfl2 - works with x64
the problem is, that with DMD 2.069.0, VS201
I'm sure I'm doing a silly mistake somewhere, but why this
doesn't work?
import std.stdio;
import std.algorithm;
struct ku
{
immutable int id;
alias id this;
this(int i)
{
id = i;
}
int opCmp(ref const ku rhs) cons
Ok... the question is not silly any more...
without 'immutable' it works. So, what am I missing?
On 11/06/2015 02:54 PM, Alex wrote:
> I'm sure I'm doing a silly mistake somewhere, but why this doesn't work?
> import std.stdio;
> import std.algorithm;
>
> struct ku
> {
> immutable int id;
> alias id this;
>
> this(int i)
> {
> id = i;
> }
>
> int opCmp(r
On Friday, 6 November 2015 at 22:55:15 UTC, Alex wrote:
Ok... the question is not silly any more...
without 'immutable' it works. So, what am I missing?
sort() fails because in the template constraint
`hasAssignableElements
On Friday, 6 November 2015 at 22:55:15 UTC, Alex wrote:
Ok... the question is not silly any more...
without 'immutable' it works. So, what am I missing?
sorry, again a forum bug that stripped my answer:
sort() fails because in the template constraint
`hasAssignableElements` fails.
hasAssignab
Hi!
I have the error message:
source/url.cache.d(20,16): Error: function
url.Cache.UrlCache.doRequest has no return statement, but is
expected to return a value of type string
Inserting dummy return statement doesn't help. final switch /
switch with default - no matter.
As I understand com
On Saturday, 7 November 2015 at 00:21:57 UTC, crimaniak wrote:
Inserting dummy return statement doesn't help. final switch /
switch with default - no matter.
Try inserting assert(0); instead of a dummy return.
On Saturday, 7 November 2015 at 00:27:02 UTC, Adam D. Ruppe wrote:
On Saturday, 7 November 2015 at 00:21:57 UTC, crimaniak wrote:
Inserting dummy return statement doesn't help. final switch /
switch with default - no matter.
Try inserting assert(0); instead of a dummy return.
Done, no diff
On Thursday, 5 November 2015 at 13:20:26 UTC, ixid wrote:
This may have been overlooked in my other thread so I wanted to
ask again:
This seems very inconsistent, does a += b not lower to a = a +
b? I guess not based on the below:
ushort a = ushort.max, b = ushort.max;
a += b; // C
On Saturday, 7 November 2015 at 00:30:29 UTC, crimaniak wrote:
On Saturday, 7 November 2015 at 00:27:02 UTC, Adam D. Ruppe
wrote:
On Saturday, 7 November 2015 at 00:21:57 UTC, crimaniak wrote:
Inserting dummy return statement doesn't help. final switch /
switch with default - no matter.
Try
On 11/06/2015 04:56 PM, BBaz wrote:
On Thursday, 5 November 2015 at 13:20:26 UTC, ixid wrote:
This may have been overlooked in my other thread so I wanted to ask
again:
This seems very inconsistent, does a += b not lower to a = a + b? I
guess not based on the below:
ushort a = ushort.max,
On Saturday, 7 November 2015 at 01:10:01 UTC, Ali Çehreli wrote:
On 11/06/2015 04:56 PM, BBaz wrote:
On Thursday, 5 November 2015 at 13:20:26 UTC, ixid wrote:
[...]
What's inconsistent is the integral promotion of the add
expression
result that stops from 4 bytes int:
---
int a, b;
a += b;
On Friday, 6 November 2015 at 01:17:20 UTC, TheFlyingFiddle wrote:
On Friday, 6 November 2015 at 00:43:49 UTC, rsw0x wrote:
On Thursday, 5 November 2015 at 23:37:45 UTC, TheFlyingFiddle
wrote:
On Thursday, 5 November 2015 at 21:24:03 UTC, TheFlyingFiddle
wrote:
[...]
I reduced it further:
[
Hi guys,
It's me again... still having some issues pop up getting started,
but I remain hopeful I'll stop needing to ask so many questions
soon.
I'm trying to use std.bitmanip.read; however, am having some
issues using it. For basic testing I'm just trying to use:
read!double(endianess
On Saturday, 7 November 2015 at 03:19:44 UTC, Charles wrote:
Hi guys,
It's me again... still having some issues pop up getting
started, but I remain hopeful I'll stop needing to ask so many
questions soon.
I'm trying to use std.bitmanip.read; however, am having some
issues using it. For bas
On Saturday, 7 November 2015 at 03:19:44 UTC, Charles wrote:
Hi guys,
It's me again... still having some issues pop up getting
started, but I remain hopeful I'll stop needing to ask so many
questions soon.
I'm trying to use std.bitmanip.read; however, am having some
issues using it. For bas
On Saturday, 7 November 2015 at 03:53:14 UTC, Nicholas Wilson
wrote:
On Saturday, 7 November 2015 at 03:19:44 UTC, Charles wrote:
Hi guys,
It's me again... still having some issues pop up getting
started, but I remain hopeful I'll stop needing to ask so many
questions soon.
I'm trying to us
On Saturday, 7 November 2015 at 03:19:44 UTC, Charles wrote:
Hi guys,
It's me again... still having some issues pop up getting
started, but I remain hopeful I'll stop needing to ask so many
questions soon.
I'm trying to use std.bitmanip.read; however, am having some
issues using it. For bas
On Saturday, 7 November 2015 at 03:19:44 UTC, Charles wrote:
I went to std.bitmanip to look for unittests using the Endian,
and the only one that does uses read!(T, endianness), which
needs endianness to be known at compile time, which I don't
have.
Missed this in my previous reply.
On Saturday, 7 November 2015 at 00:21:57 UTC, crimaniak wrote:
Hi!
I have the error message:
source/url.cache.d(20,16): Error: function
url.Cache.UrlCache.doRequest has no return statement, but is
expected to return a value of type string
[...]
Because the "switch" is marked as "final", ev
On Saturday, 7 November 2015 at 04:25:00 UTC, Mike Parker wrote:
Missed this in my previous reply.
No problem. I appreciate you taking the time to help me either
way :)
On Saturday, 7 November 2015 at 00:21:57 UTC, crimaniak wrote:
[...]
url.Cache.UrlCache.doRequest has no return statement, but is
expected to return a value of type string
[...]
public string doRealRequest(string url, Method method)
You posted the wrong code sample: your code shows d
On Saturday, 7 November 2015 at 03:18:59 UTC, steven kladitis
wrote:
[...]
I am still disappointed that DMD is not native 64 bit in
windows yet.
[...]
It's because they can't make a nice distribution. DMD win32 is a
nice package that works out of the box (compiler, standard C lib,
standard
On 06.11.2015 20:05, Spacen Jasset wrote:
Also, I had to add a dummy private constructor to make my structs
'createable', or is there another way?
e.g.
struct Texture
{
@disable this();
static Texture create()
{
return Texture(0);
}
...
private:
this(int)
{
55 matches
Mail list logo