mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 21:51:40 +03:00
The standard library of the D programming language
algorithmsallocatorconcurrencycontainersddlangfunctionalhacktoberfestmathmetaparallelismphobosrangesregexstandard-librarystdiotraitstype-conversionunicode
![]() 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. |
||
---|---|---|
.circleci | ||
.github/workflows | ||
changelog | ||
etc/c | ||
phobos | ||
std | ||
test | ||
tools | ||
.codecov.yml | ||
.dscanner.ini | ||
.editorconfig | ||
.gitignore | ||
build_v3.d | ||
CODEOWNERS | ||
CONTRIBUTING.md | ||
index.dd | ||
LICENSE_1_0.txt | ||
Makefile | ||
posix.mak | ||
project.ddoc | ||
README.md | ||
unittest.d |
Phobos Standard Library
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.