Mark error_message in numeric_cast as unused

In a release build without assertions or exceptions
enabled, `TSL_RH_THROW_OR_TERMINATE` is essentially a no-op
and we get a compiler warning that the error_message is unused:

```
In file included from .../robin-map/include/tsl/robin_map.h:34:
.../robin-map/include/tsl/robin_hash.h:77:35: warning: unused parameter 'error_message' [-Wunused-parameter]
                      const char* error_message = "numeric_cast() failed.") {
                                  ^
1 warning generated
```

Fix this by adding a `TSL_RH_UNUSED` for the error message here.
In C++17, the `[[maybe_unused]]` should be used instead.
This commit is contained in:
Milian Wolff
2023-09-16 16:25:42 +02:00
committed by Thibaut Goetghebuer-Planchon
parent 851a59e0e3
commit 0430aee4df

View File

@@ -87,6 +87,8 @@ static T numeric_cast(U value,
TSL_RH_THROW_OR_TERMINATE(std::runtime_error, error_message);
}
TSL_RH_UNUSED(error_message)
return ret;
}