Windows scaffold: include Windows.Foundation.Collections in pch.h - #100
Open
turinglambdaai wants to merge 1 commit into
Open
turinglambdaai wants to merge 1 commit into
turinglambdaai wants to merge 1 commit into
Conversation
Any scaffolded app that touches an IVector/IIterable — ListView-style children, range-for over JSON arrays, anything with Children().Append or .begin() — fails with dozens of C3779 'a function that returns auto cannot be used before it is defined' errors, because the consume templates are declared by other headers but defined in winrt/Windows.Foundation.Collections.h, which pch.h did not include. Hit building a production app on this scaffold (payback); the include is cheap for apps that do not need it and saves a very confusing riddle for every app that does.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Any scaffolded Windows app that touches an IVector/IIterable — building card lists with
Children().Append, range-for overJsonArray.GetArray(), anything that calls.begin()on a projected collection — fails with dozens ofbecause the consume templates are declared by the Control/other headers but defined in
winrt/Windows.Foundation.Collections.h, which the scaffold's pch.h did not include. The error text points nowhere near the missing include.Fix
One line in the scaffold pch.h.
Verification
Building a production app on this scaffold (payback, turinglambdaai/payback): 76 errors of exactly that shape before the include, zero after — the rest of that diff was app code.