I am implementing my own boost::array
variant for fun and education, and I was just wondering: should comparing two arrays of different size yield false, or should it be a type error?
array<int, 3> a = {1, 2, 3};
array<int, 5> b = {1, 2, 3, 4, 5};
a == b // <--- false or type error?
It should be a type-error. People that use boost::array
choose it over std::vector
because they want evaluation (and failure) at compile-time rather than run-time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With