Use a procedural macro that reads the config value and generates the const L using the value specified before compilation.

Reply to this note

Please Login to reply.

Discussion

Ah thanks, I wasn't entirely sure from a brief read whether proc macros could do it or not, I will research it more, thanks.

Oh, if the user is not compiling this will not work. You will have to generate the function and compile it for each L value you want your users to be able to configure. A declarative macro would work for that.

Ah ok thanks that's more in line with what I was expecting.