I want to rewrite the following C++ code into Rust:
using storage = array<int, 3>;
const size_t storage_len = sizeof(storage) / sizeof(storage::value_type);
How can I get that constant length value without a concrete variable?
As motivation, although it may seem trivial, I want to print the array's element count without declaring a variable. I know I could use a constant value or declare a dummy variable, but I wonder how Rust can preserve C++ code.
I admit without a concrete variable is not clear. I want to achieve the above C++ feature, but this explanation can be misleading. I'm curious if there is any way to get the array's element type.