String::is_empty
in std::string
is fn
instead of const fn
for now.
- I'm curious why isn't it
const fn
yet? - If we can stablize it to
const fn
, how can I start for it?
String::is_empty
in std::string
is fn
instead of const fn
for now.
const fn
yet?const fn
, how can I start for it?str::is_empty
is const and probably what you are looking for. String
s are heap allocated and have a destructor, which makes the pretty much unusable in const contexts as of right now.
Thanks for the answer!
I was curious how to stablize String::is_empty
to const fn
but I got it why it isn't const fn
.