std.format.formatValue: Names instead of integer values for enum members. #65

Merged
merged 2 commits into from Jun 1, 2011

Conversation

Projects
None yet
2 participants
@klickverbot
Member

klickverbot commented May 29, 2011

std.format.formatValue: Names instead of integer values for enum members.

to!string(someEnum) is already implemented like that, which led to writeln(to!string(someEnum)) and writeln(someEnum) giving different results.

std.format.formatValue: Names instead of integer values for enum memb…
…ers.

to!string(someEnum) is already implemented like that, which led to writeln(to!string(someEnum)) and writeln(someEnum) giving different results.
@andralex

This comment has been minimized.

Show comment
Hide comment
@andralex

andralex May 31, 2011

Instead of throwing, how about printing something like cast(T) rawVal? Some valid uses of enums use unnamed values.

Instead of throwing, how about printing something like cast(T) rawVal? Some valid uses of enums use unnamed values.

This comment has been minimized.

Show comment
Hide comment
@klickverbot

klickverbot May 31, 2011

Owner
Owner

klickverbot replied May 31, 2011

Enum formatting: Do not fail on values not corresponding to a member.
Instead, »cast(EnumType)rawValue« is printed/returned for these cases.

andralex added a commit that referenced this pull request Jun 1, 2011

Merge pull request #65 from klickverbot/format-enum-value
std.format.formatValue: Names instead of integer values for enum members.

@andralex andralex merged commit cbe0d06 into dlang:master Jun 1, 2011

NilsBossung pushed a commit to NilsBossung/phobos that referenced this pull request Jun 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment