Passing Lambda Variables not working in HISE?
-
On both my systems I receive an error in the console when trying to pass a labmda variable (from inline function to function). This was prompted by the recent videos @David-Healey shared on the topic. The functions seem to work but I am not sure why I receive the error.
Interface:! Line 6, column 60: Accessing parameter reference outside the function callThe examples from the HISE docs are also producing the same error. I know I can script around this if necessary but I am curious to know if anyone else is experiencing the same issue?
Wonder if this is a question for @Christoph-Hart ? Does using lambdas require a certain version of C++? In Visual Studio 2026 the C++ Language Standard is set to
ISO C++20 Standard (/std:c++20), so I think I should be covered here.Anyone else seeing these error messages?
HiseSnippet 790.3ocsUstaSCCE1tqYhFtHlDO.Q6WcnwVur0QYHXr0VnBZWEsL.gPStNNKVKwNJwYiJzdR3kj2.33jrdgU1FUB+inbt4ymO96bbuPIkEEICQXyAiBXH78L5ORnbOvkvEn1MP3GXzgDoXgVop1eT.IJhYiv3kdsVAtPdTx5mubehGQPYSTgPGI4T1639b0Ds816sbOuVDa1.t+Tdu0dsoRwAROYLfmkLJgBHzSImv5Rztky.8FRjKB+XipCcpsEs7NCI6To9v50pUea6pN1jJUYzgCIUXf4s11oFBubSatRF1WQTrHDN+9R6Q8ckmKRSvQ7H9POlVnLpOj4T0sjd15inVK5.WtmcuKKTQHXW5MorsTZY6QFc317w5mT9dXhAqIQLcADmaV3szLvq7eCdyAR3ofT9THshQeZHOPMwhFO20ns.tMcHv8zzPI0WTtefMNPBdHTa3SNk0JDDFGQwZkJstE7YscMM4BOtfY4DKnJtTXEI8YsxDJxEAwp0L+tYgM2z5lVCb4QVg7SbUVtrP1yrd9SzqWXVno3DHGaDAkjOyh5J+HWXKOu3pC3JO1pqasZG3jALD32w33KI49qEkmtlYA..EfySjzisQPHWnxP1tlEt.9bAbNlA20gi13cRJ5JUrCEESNHlWXZ8mlbblqMcELT54wBmqYMsO75BrnH1eHKbcqyHdwrwNBWsyxWV91wWnoWnS4nTzVvUGFvxjudBOJiQ.+8g1MHJhlvkoC7KfEp3Z3favNCZ2SoeELZvhNUICfF9qvMgtBocrGQMaqhdfRlAndLC+TyAEQb0noG37Oz+T5Z6etsPbEidbE0c9XL2bvHTo9efwroN22noiCipl.v7Fs9zhNh4FR+6kwJt3jNDUH+aHrQ2X+9vjZJCxtPv7fM2.mSyVRkKok0Uf9LgchvufUlwxZYblwxWZD4SngxioocA54Z2IQCfIQxa.EfGi.YqxnjNioqy9vX1iozY2pqDXkEMvpKZfasnAt8hFXsEMvcVz.e5MGn9UvWEqj9osMHTmdMSFkfwMEDfAlvVQ+FVk6WTA -
H HISEnberg marked this topic as a question
-
@HISEnberg haha don‘t mix up the extremely complex issue of C++ lambdas (where the C++ standard does in fact have an impact) with our little „lamda“ extension to HiseScript where you can just pass on some variables in a function to a sub function call.
Usually you just need to rename and introduce a variable from a function parameter because you cannot pass on an incoming parameter from the outside function. However this might be another case of „var-local“-gate where I could easily patch things up internally so you and the robot overlords will not need that information in your context window…
-
@Christoph-Hart He's using lambda's as expected in HISE - I'm not seeing the error he reports, do you see it?