Added static sign validation for ALFunction
This commit is contained in:
@@ -3,14 +3,20 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include <limits>
|
||||
#include <string>
|
||||
|
||||
template<class STORAGE, size_t VALUES_COUNT>
|
||||
class Function {
|
||||
public:
|
||||
Function(): _function_values(0) {}
|
||||
explicit Function(STORAGE val): _function_values(val) {}
|
||||
Function(): _function_values(0) {
|
||||
static_assert(not std::numeric_limits<STORAGE>::is_signed);
|
||||
}
|
||||
explicit Function(STORAGE val): _function_values(val) {
|
||||
static_assert(not std::numeric_limits<STORAGE>::is_signed);
|
||||
}
|
||||
explicit Function(std::string val): _function_values(0) {
|
||||
static_assert(not std::numeric_limits<STORAGE>::is_signed);
|
||||
assert(("bad input string size", val.size() == VALUES_COUNT));
|
||||
STORAGE cur_dig = 1;
|
||||
for (auto it = val.rbegin(); it != val.rend(); ++it) {
|
||||
|
||||
Reference in New Issue
Block a user