divisible static_assert only if max_log != 0

This commit is contained in:
EntireTwix 2021-06-03 18:30:40 -07:00
parent 48c4d73cbc
commit 819a77a299

View file

@ -23,8 +23,10 @@ void SaveSig(int s)
int main(int argc, char **argv)
{
static_assert(pre_log_size <= max_log_size, "`max_log_size` must be larger than `pre_log_size`.");
static_assert(!(max_log_size % pre_log_size), "`max_log_size` must be a multiple of `pre_log_size`.");
if constexpr (max_log_size)
{
static_assert(!(max_log_size % pre_log_size), "`max_log_size` must be a multiple of `pre_log_size`.");
}
if (argc != 4)
{
std::cerr << "Usage: sudo ./bank <admin password> <saving frequency in minutes> <threads>\n";