Skip to content

Commit

Permalink
Clarifcations in exiting solutions.
Browse files Browse the repository at this point in the history
  • Loading branch information
skl131313 committed Jan 2, 2018
1 parent b15c019 commit ed079eb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions DIPs/dip10ss.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Parameter:

## Existing Solutions

Apply UDA through parent symbol with additional information for which child it should be applied to:
A current solution for applying an UDA to an enum or parameter is to use an UDA on the parent symbol with some additional information for which child element it should be applied to. This allows the desired UDA to be used and associated with the desired symbol. It introduces some duplication and the information stored in the UDA is separated from the rest of the information of the symbol.

```D
@MyUda("feature0", "...")
Expand All @@ -101,9 +101,7 @@ void foo(int param0)
}
```

This allows the desired UDA to be used and associated with the desired symbol. It introduces some duplication and the information stored in the UDA is separated from the rest of the information of the symbol.

Deprecation of an enum can be done by reimplementing an enum as a structure with static enums as follows:
A solution for the deprecation of an enum can be done by reimplementing an enum as a structure with static enums. This allows the `deprecation` attribute to be placed with the desired enum member.

```D
enum SomeEnumImpl
Expand All @@ -113,7 +111,7 @@ enum SomeEnumImpl
actualValue3 = 3,
}
public struct SomeEnum
struct SomeEnum
{
SomeEnumImpl x;
alias this x;
Expand Down

0 comments on commit ed079eb

Please sign in to comment.