Assuming next declaration in lime:
struct Foo {
const BAR: String = "bar text"
}
Gluecodium generates struct with static const std::string fields:
struct Foo {
static const std::string BAR;
}
It leads to waisting of memory, warnings that constructor of std::string may throw an uncaught exception and undefined initialisation order in case when user code relies on those constants.
Possible solution which may solve all these problems: use std::string_view from C++17. Gluecodium may generate something like this:
struct Foo {
constexpr std::string_view BAR = "bar text";
}
Also consider to generate to_string for enums using string_view.