Skip to content

Fix type order stability in C++/WinRT headers#287

Merged
kennykerr merged 2 commits into
masterfrom
kennykerr-depends
Apr 5, 2019
Merged

Fix type order stability in C++/WinRT headers#287
kennykerr merged 2 commits into
masterfrom
kennykerr-depends

Conversation

@kennykerr

Copy link
Copy Markdown
Contributor

Type declaration order can become unpredictable, leading to headers changing when they shouldn't. This can cause PCH files to recompile unnecessarily.


struct depends_compare
{
bool operator()(TypeDef const& left, TypeDef const& right) const

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

noexcept

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The trouble is that the TypeDef's TypeName and TypeNamespace members are not noexcept so any error retrieving those values would not propagate to a console error message but would instead crash the compiler.

@kennykerr kennykerr merged commit 9f089fd into master Apr 5, 2019
@kennykerr kennykerr deleted the kennykerr-depends branch April 5, 2019 19:30
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.

3 participants