Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix generated code for huge
const
collections.
When unrolling constructors of collections we previously would always capture explicitly so that container elements could reference other variables in the scope. This breaks for `const` variables which are emitted at non-local scope (into a namespace); the lambda performing the initialization would also be a non-local and non-local lambdas are not allowed to capture anything (they do not live in a scope after all). This means that we cannot capture for such lambdas at all which seems to be an issue -- after all with that it seems impossible to support constructors of collections which reference other `const`s. Fortunately C++ lambdas at non-local scope implicitly capture other non-locals already and they do not need to be captured explictly. This allows for a rather simple fix. Closes #1760.
- Loading branch information