Skip to content

[Hashable] hana::integral_constant with an enum value implements Hashable - #440

Open
Dwarfobserver wants to merge 1 commit into
boostorg:developfrom
Dwarfobserver:feature/hashable-integral-constant-enums
Open

[Hashable] hana::integral_constant with an enum value implements Hashable#440
Dwarfobserver wants to merge 1 commit into
boostorg:developfrom
Dwarfobserver:feature/hashable-integral-constant-enums

Conversation

@Dwarfobserver

Copy link
Copy Markdown

Hi, this is my first contribution to Boost.Hana, so please tell me my mistakes :)

This small change implements Hashable for hana::integral_constant with an enumeration value :
It allows for example to use enumeration values as key for hana::map.

@ricejasonf

ricejasonf commented Feb 21, 2019

Copy link
Copy Markdown
Collaborator

I think CI failed because it found trailing spaces. The github site doesn't seem to reflect that though.

$ LANG=POSIX grep '[[:blank:]]$' "${sources[@]}"; [[ $? == 1 ]] || exit 1 is the last command ran in the log but with no error message.

@Dwarfobserver

Copy link
Copy Markdown
Author

Indeed, good catch ! I corrected them.

@ricejasonf

Copy link
Copy Markdown
Collaborator

lgtm, but please "fixup" the commit so there is one commit.

@ldionne is currently at a standards committee meeting, so I don't know when he will look at this.

@Dwarfobserver
Dwarfobserver force-pushed the feature/hashable-integral-constant-enums branch from 864e975 to 64a9a40 Compare February 23, 2019 10:51
@Dwarfobserver

Copy link
Copy Markdown
Author

Sorry, I thought it was only for local commits ! Done :)

@vyzaq

vyzaq commented Jun 17, 2020

Copy link
Copy Markdown

Do you have any progress on that PR?

@ReiserFlorian

Copy link
Copy Markdown

I would like to have this feature, too

> {
template <typename X>
static constexpr auto apply(X const&) {
return hana::type_c<X>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just taking a second look at this, is there a reason it does not normalize to hana::type<hana::integral_constant<T, X::value> as the others do?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants