Skip to content
This repository was archived by the owner on Mar 26, 2020. It is now read-only.

Added support for constexpr for primitives in header files#354

Merged
xianwen merged 1 commit into
dropbox:masterfrom
alancast:constexpr_support
May 1, 2018
Merged

Added support for constexpr for primitives in header files#354
xianwen merged 1 commit into
dropbox:masterfrom
alancast:constexpr_support

Conversation

@alancast

Copy link
Copy Markdown
Contributor

The problem here is that if you have a record of const ints, for example a record of error codes, you can not switch case them as the values are not set in the header. This PR adds constexpr support for const primitives in header files so that this is doable. It also fixes const enum values in Objective C, which appeared to never have been working.

It excludes optional primitives as they might not support constexpr (if using things like boost optional)

(It is based off PR #282 which appears to have been abandoned)

  • Got a basic version of constexpr in headers working

  • got enum values to work as well

  • can't do enums because interface headers forward declare so you can't set it there. So only primitives allowed

  • fixing const enums in obj-c, which apparently never worked to begin with

* Got a basic version of constexpr in headers working

* got enum values to work as well

* can't do enums because interface headers forward declare so you can't set it there. So only primitives allowed

* fixing const enums in obj-c, which apparently never worked to begin with
@xianwen

xianwen commented Mar 30, 2018

Copy link
Copy Markdown

Hi, Alan:
I noticed you haven't signed the CLA yet, could you please sign it here: https://opensource.dropbox.com/cla/

Thanks a lot!

@xianwen xianwen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, and all tests passed. Once you signed CLA, I can merge it into master. Thanks!

@alancast

alancast commented Apr 6, 2018

Copy link
Copy Markdown
Contributor Author

I think I just signed it so we should be good to go now :-)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants