The standard library of the D programming language
Find a file
Jonathan M Davis f0c3e4a66b
Fix Bugzilla issue 24827: maxElement does not handle opAssign correctly. (#9067)
Rebindable2 did not handle types with opAssign correctly, which affected
both minElement and maxElement. Namely, Rebindable2 assigned to memory
which was not properly initialized when the correct solution in such a
situation is to use copyEmplace. Assignment works when assignment is
just a memcpy, but in the general case, opAssign needs to have a
properly initialized object in order to work correctly. copyEmplace
instead copies the object and then places the copy into the unitialized
memory, so it avoids assigning to uninitialized memory.

This commit also adds additional tests for types with destructors (which
do get opAssign automatically) and types with postblit constructors or
copy constructors to try to ensure that the code is doing the correct
thing in those cases with regards to copying, assignment, and
destruction.

https://issues.dlang.org/show_bug.cgi?id=24829 was found in the process,
and this does not fix that. Namely, types which cannot be assigned to
and which also have a postblit constructor or copy constructor do not
get copied correctly. So, among the tests added here are commented out
tests for that case, since they're an altered version of some of the
enabled tests. However, fixing that issue would be involved enough that
I'm not attempting to fix it at this time.
2024-10-27 01:16:22 -07:00
.circleci Merge Makefiles 2023-12-16 22:22:20 +01:00
.github/workflows Revert "Add DUB install to VM initialization. (#8992)" (#8999) 2024-05-04 12:55:46 +02:00
changelog purge changelog 2024-06-02 00:29:27 +00:00
etc/c Sync etc.c.zlib D bindings with updated zlib.h 2024-02-26 13:47:01 +08:00
phobos/sys Add FieldNames, FieldSymbols, and FieldTypes to phobos.sys.traits. (#8986) 2024-04-21 15:57:19 -07:00
std Fix Bugzilla issue 24827: maxElement does not handle opAssign correctly. (#9067) 2024-10-27 01:16:22 -07:00
test Add sumtype to Phobos (#7702) 2021-03-05 12:41:34 +01:00
tools Remove explicit hex string casts 2024-03-19 23:48:15 +01:00
.codecov.yml yaml: make files comply with YAML specification 2021-08-30 14:54:57 +00:00
.dscanner.ini sumtype: add overload-set matching example 2024-05-31 11:22:43 -04:00
.editorconfig Fix line endings in .editorconfig 2018-09-16 12:19:04 -07:00
.gitignore Phobos 3 Setup (#8925) 2024-02-28 02:14:35 -08:00
CODEOWNERS Upstream Unicode table generator and update tables to v15 2022-12-12 02:10:14 +13:00
CONTRIBUTING.md Fix IRC link. (Freenode is dead, #d has been on libera for years.) 2024-01-17 15:41:09 +01:00
dub.sdl Rename lib to phobos. (#8953) 2024-03-20 15:12:06 -07:00
index.dd Remove deprecated std.xml module 2022-08-28 11:30:15 +02:00
LICENSE_1_0.txt
Makefile Merge pull request #9007 from pbackus/improve-sumtype-examples 2024-06-17 12:01:00 +02:00
posix.mak Restore posix.mak, forwarding to generic Makefile 2023-12-16 22:22:20 +01:00
project.ddoc
README.md Remove no longer available issue stats and add a Buildkite badge 2019-01-04 18:02:28 +01:00
unittest.d Remove deprecated symbols from std.digest.digest 2020-04-09 11:35:23 +02:00

D Logo Phobos Standard Library

GitHub tag Bugzilla Issues CircleCi Buildkite Code coverage license

Phobos is the standard library that comes with the D Programming Language Compiler.

Download

Phobos is packaged together with the compiler. You should download the whole precompiled package.

To build everything yourself, there is a description in the wiki.

Phobos is distributed under Boost Software Licence. See the licence file.

I Want to Contribute

Great! See the CONTRIBUTING.md file.