The standard library of the D programming language
Find a file
Jonathan M Davis 43f00ee83d Fix phobos.sys.traits.isAggregateType to handle enums.
The std.traits version does not take enums into account (and prior to
this commit, neither does the phobos.sys version), but upon reflection,
it seems like it's just likely to cause bugs if it doesn't take enums
into account. Granted, enums whose base type is an aggregate type don't
seem to be very common, but as a result of that, code that tests for
aggregate types likely won't take them into account in the vast majority
of cases, and I see no reason to not have the trait just deal with it
rather than hoping that the user of the trait realizes that it's a
potential issue, in which case, they would need to explicitly use
OriginalType themselves to make it work for enums.

In addition, this way, OriginalType doesn't even get instantiated unless
the type is actually an enum, whereas the correct solution that would
most likely be used otherwise would be to just always do
isAggregateType!(OriginalType!T) instead of isAggregateType!T.

I also put a ddoc comment on the unittest block, since I apparently
missed it previously.
2024-11-23 12:25:19 +01:00
.circleci Merge Makefiles 2023-12-16 22:22:20 +01:00
.github/workflows GitHub Actions: Remove macos-12 job, as the image will disappear soon (#9085) 2024-11-17 08:08:31 +08:00
changelog Add fromHexString, fromHexStringAsRange and isHexString 2024-11-03 17:59:26 +08:00
etc/c Sync etc.c.zlib D bindings with updated zlib.h 2024-02-26 13:47:01 +08:00
phobos Fix phobos.sys.traits.isAggregateType to handle enums. 2024-11-23 12:25:19 +01:00
std sumtype: add fast path for single dispatch 2024-11-20 15:25:01 -05:00
test Add sumtype to Phobos (#7702) 2021-03-05 12:41:34 +01:00
tools Update to unicode 16.0.0 (#9058) 2024-10-16 06:24:56 +08:00
.codecov.yml yaml: make files comply with YAML specification 2021-08-30 14:54:57 +00:00
.dscanner.ini Silence buildkite style failure on std.range 2024-07-31 15:25:37 +02:00
.editorconfig Fix line endings in .editorconfig 2018-09-16 12:19:04 -07:00
.gitignore Remove Phobos 3 dub.sdl and replace it with the build_v3.d build script. (#9069) 2024-10-25 17:49:41 -07:00
build_v3.d Remove Phobos 3 dub.sdl and replace it with the build_v3.d build script. (#9069) 2024-10-25 17:49:41 -07: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
index.dd Remove deprecated std.xml module 2022-08-28 11:30:15 +02:00
LICENSE_1_0.txt Changed Phobos to use the Boost license. Currently, all public domain modules and all licensed modules by Walter, Andrei, Bartosz, and Don have been changed to use this license (excepting std.c, for the moment). Ideally, all Phobos modules will eventually be distributed under this license, which means obtaining permission from a few more authors, deleting, or rewriting some modules. 2009-09-16 18:19:51 +00:00
Makefile Remove -de switch from Phobos builds to allow deprecations. 2024-09-20 15:06:49 +02:00
posix.mak Restore posix.mak, forwarding to generic Makefile 2023-12-16 22:22:20 +01:00
project.ddoc add PROJECT=phobos ddoc macro 2014-01-10 19:16:53 +01:00
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.