fixes to support -Wstring-conversion compiler warning
Summary: We're in the process of enable `-Wstring-conversion` in the default arvr build modes. The reason is that it flags legitimate bugs such as
@@ -75,7 +75,7 @@ namespace fixedstring {
// it's testing for fails. In this way, precondition violations are reported
// at compile-time instead of at runtime.
[[noreturn]] inline void assertOutOfBounds() {
- assert(!"Array index out of bounds in SimpleFixedString");
+ assert(!(bool)"Array index out of bounds in SimpleFixedString");
throw std::out_of_range(
"Array index out of bounds in SimpleFixedString");
}
@@ -92,7 +92,7 @@ constexpr std::size_t checkOverflowOrNpos(std::size_t i, std::size_t max) {
// Intentionally NOT constexpr. See note above for assertOutOfBounds
[[noreturn]] inline void assertNotNullTerminated() noexcept {
- assert(!"Non-null terminated string used to initialize a SimpleFixedString");
+ assert(!(bool)"Non-null terminated string used to initialize a SimpleFixedString");
std::terminate(); // Fail hard, fail fast.
}
