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

Added support for constexpr for primitives in header files #354

Merged
merged 1 commit into from
May 1, 2018

Conversation

alancast
Copy link
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
Copy link

xianwen commented Mar 30, 2018

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!

Copy link

@xianwen xianwen left a comment

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
Copy link
Contributor Author

alancast commented Apr 6, 2018

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