Force loop variables to be const&.
Fix argument capture in lambda.
Set function's copy bit based on argument pass.
Set PDirect to no hasCopy by default.