digitalmars.D.learn - Container Purity
- =?UTF-8?B?Tm9yZGzDtnc=?= (8/8) Dec 09 2015 Is it currently possible for a container such as
- =?UTF-8?B?Tm9yZGzDtnc=?= (2/3) Dec 09 2015 Correction: I mean std.experimental.allocator
- Kagamin (2/2) Dec 09 2015 Allocators usually use global state. Such code is usually treated
- =?UTF-8?B?Tm9yZGzDtnc=?= (4/6) Dec 09 2015 What about containers that store their own local allocator? Will
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 as pure in DynamicArray at https://github.com/economicmodeling/containers/blob/master/src/containers/dynamicarray.d are marked as pure. Is there a reason for this?
Dec 09 2015
On Wednesday, 9 December 2015 at 10:47:18 UTC, Nordlöw wrote:that uses std.experimental.containerCorrection: I mean std.experimental.allocator
Dec 09 2015
Allocators usually use global state. Such code is usually treated as impure.
Dec 09 2015
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 structures?
Dec 09 2015