On Saturday, 17 February 2018 at 14:54:37 UTC, ag0aep6g wrote:
Nordlöw's methods are only weakly pure. They have mutable
indirections either in the return type or in a parameter type.
So calls to them should not be optimized away.
I found a solution at
https://github.com/nordlow/phobos-next/b
On 2/17/18 9:54 AM, ag0aep6g wrote:
On 02/17/2018 03:04 PM, Steven Schveighoffer wrote:
You have to be a bit careful here. pure functions can assume nothing
is happening and simply not call the function.
That's only a problem when the called function is strongly pure, right?
Nordlöw's methods
On Saturday, 17 February 2018 at 12:33:25 UTC, Nordlöw wrote:
I'm struggling with making
https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d
callable in pure functions such as here
https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d#L84
Shouldn't a sh
On 02/17/2018 03:04 PM, Steven Schveighoffer wrote:
You have to be a bit careful here. pure functions can assume nothing is
happening and simply not call the function.
That's only a problem when the called function is strongly pure, right?
Nordlöw's methods are only weakly pure. They have muta
On 2/17/18 8:32 AM, ag0aep6g wrote:
On 02/17/2018 01:35 PM, rikki cattermole wrote:
pure means no globals. As in none :)
... except immutable ones. And since PureMallocator has no fields,
`instance` can be made immutable, and all the methods can be made static
or const. Then they can be used
On 2/17/18 7:33 AM, Nordlöw wrote:
I'm struggling with making
https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d
callable in pure functions such as here
https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d#L84
Shouldn't a shared
static shared
On 02/17/2018 01:35 PM, rikki cattermole wrote:
pure means no globals. As in none :)
... except immutable ones. And since PureMallocator has no fields,
`instance` can be made immutable, and all the methods can be made static
or const. Then they can be used in `pure` code.
On Saturday, 17 February 2018 at 12:35:00 UTC, rikki cattermole
wrote:
in pure functions?
pure means no globals. As in none :)
I guess one solution is to make the member functions in
PureMallocator static and change how the template argument
`Allocator` for a container is used to call these
On 17/02/2018 12:48 PM, Nordlöw wrote:
On Saturday, 17 February 2018 at 12:35:00 UTC, rikki cattermole wrote:
in pure functions?
pure means no globals. As in none :)
I don't understand.
I thought std.experimental.allocators API was designed to be able
express these needs, @andralex?
Libr
On Saturday, 17 February 2018 at 12:35:00 UTC, rikki cattermole
wrote:
in pure functions?
pure means no globals. As in none :)
I don't understand.
I thought std.experimental.allocators API was designed to be able
express these needs, @andralex?
On Saturday, 17 February 2018 at 12:33:25 UTC, Nordlöw wrote:
PureMallocator.instance.allocate(16);
currently errors as
pure_mallocator.d(84,16): Error: pure function
'pure_mallocator.__unittest_pure_mallocator_82_0' cannot access
mutable static data 'instance'
I'm struggling with making
https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d
callable in pure functions such as here
https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d#L84
Shouldn't a shared
static shared PureMallocator instance;
make it possi
On 17/02/2018 12:33 PM, Nordlöw wrote:
I'm struggling with making
https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d
callable in pure functions such as here
https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d#L84
Shouldn't a shared
static sh
13 matches
Mail list logo