Add reusable assert template

This commit is contained in:
TheAssassin
2020-08-07 13:34:11 +02:00
parent e1f6da17b4
commit 55b2d00f23

View File

@@ -0,0 +1,17 @@
#pragma once
// system headers
#include <stdexcept>
namespace linuxdeploy {
namespace util {
namespace assert {
template<typename T>
void assert_not_empty(T container) {
if (container.empty()) {
throw std::invalid_argument{"container must not be empty"};
}
}
}
}
}