On Thursday, 10 December 2015 at 00:36:27 UTC, Jon D wrote:
Question I have is if there is a better way to do this. For
example, a different way to construct the lazy
'decodeUTF8Range' rather than writing it out in this fashion.
A further thought - The decodeUTF8Range function is basically
co
I want to combine block reads with lazy conversion of utf-8
characters to dchars. Solution I came with is in the program
below. This works fine. Has good performance, etc.
Question I have is if there is a better way to do this. For
example, a different way to construct the lazy 'decodeUTF8Rang
On Wednesday, 9 December 2015 at 21:23:03 UTC, Daniel Kozák wrote:
V Wed, 09 Dec 2015 21:10:43 +
Jon D via Digitalmars-d-learn
napsáno:
There is a fair bit of range related code in the standard
library structured like:
auto MyRange(Range)(Range r)
if (isInputRange!Range)
V Wed, 09 Dec 2015 21:10:43 +
Jon D via Digitalmars-d-learn
napsáno:
> There is a fair bit of range related code in the standard library
> structured like:
>
> auto MyRange(Range)(Range r)
> if (isInputRange!Range)
> {
> static struct Result
> {
>
heh. it crashed due to "in" presence. if you'll remove "in", it
will work.
There is a fair bit of range related code in the standard library
structured like:
auto MyRange(Range)(Range r)
if (isInputRange!Range)
{
static struct Result
{
private Range source;
// define empty, front, popFront, etc
}
On Wednesday, 9 December 2015 at 13:23:00 UTC, Tim K. wrote:
On Wednesday, 9 December 2015 at 13:13:36 UTC, BBaz wrote:
Is there a convenience function that allows me to remove an/all
object(s) with a certain value from an array or do I need to
write one myself?
Here are some elements of str
version with apr (like in c version)
http://dpaste.dzfl.pl/68c0157225e7
compiled with ldc it's indeed a bit faster on average :
real0m1.999s
user0m9.810s
sys 0m0.148
btw Rust version is even faster than my little bit outdated gcc
(4.9)
latest try with allocators :
http://dpaste.dzf
On Wednesday, 9 December 2015 at 11:46:45 UTC, Kagamin wrote:
Allocators usually use global state. Such code is usually
treated as impure.
What about containers that store their own local allocator? Will
DMD infer all members of such containers to be pure if they only
access locally allocated
On Wednesday, 9 December 2015 at 13:13:36 UTC, BBaz wrote:
3) opEquals can be 'const' because the method doesn't mutate
the state of the object
4) your cast wasn't safe
http://dlang.org/phobos/std_algorithm_mutation.html#.remove
Maybe something like this works better:
...
override bool
On Wednesday, 9 December 2015 at 13:23:00 UTC, Tim K. wrote:
On Wednesday, 9 December 2015 at 13:13:36 UTC, BBaz wrote:
1) remove works with an index
I guess I did read it wrong. Sorry.
Is there a convenience function that allows me to remove an/all
object(s) with a certain value from an arra
On Wednesday, 9 December 2015 at 13:13:36 UTC, BBaz wrote:
1) remove works with an index
I guess I did read it wrong. Sorry.
Is there a convenience function that allows me to remove an/all
object(s) with a certain value from an array or do I need to
write one myself?
2) remove does not rem
On Wednesday, 9 December 2015 at 13:05:31 UTC, Tim K. wrote:
Hi!
I'm trying to remove an item from an array of objects. But I
get error messages when compiling (see below) which I do not
understand. I figured I had to override opEquals for it to
work, but no.
How do I get this to work?
You
Hi!
I'm trying to remove an item from an array of objects. But I get
error messages when compiling (see below) which I do not
understand. I figured I had to override opEquals for it to work,
but no.
How do I get this to work?
Regards
class A
{
this(string si, uint ui) { s
Allocators usually use global state. Such code is usually treated
as impure.
On Wednesday, 9 December 2015 at 10:47:18 UTC, Nordlöw wrote:
that uses std.experimental.container
Correction: I mean std.experimental.allocator
Is it currently possible for a container such as
https://github.com/economicmodeling/containers/blob/master/src/containers/dynamicarray.d
that uses std.experimental.container
to be completely pure? If not can be made to?
I wonder because only length(), empty(), front() and back() are
tagged a
On Tuesday, 8 December 2015 at 16:40:04 UTC, Taylor Hillegeist
wrote:
However i seem to get jitter of around 1 ms. Is there anything
else i can do to improve?
Do you want to get precision better than period of thread
switches?
On Wednesday, 9 December 2015 at 10:00:46 UTC, Andrea Fontana
wrote:
On Tuesday, 8 December 2015 at 15:35:18 UTC, Taylor Hillegeist
wrote:
So, I mostly do programming that is of run to completion
verity. But I have a dream of calling functions periodically.
So my question is:
What is the best
On Tuesday, 8 December 2015 at 15:35:18 UTC, Taylor Hillegeist
wrote:
So, I mostly do programming that is of run to completion
verity. But I have a dream of calling functions periodically.
So my question is:
What is the best (most time accurate) way to call a function
every n time units?
Wha
20 matches
Mail list logo