|
11 | 11 | #include <list> |
12 | 12 | #include <map> |
13 | 13 | #include <string> |
| 14 | +#include <type_traits> |
14 | 15 | #include <unordered_map> |
15 | 16 |
|
16 | 17 | // Max line length for reading xml |
@@ -132,6 +133,10 @@ template <typename T> |
132 | 133 | void serializeFunc2DVector(FILE *file, size_t chunksize, |
133 | 134 | const std::vector<std::vector<T>> &steps, |
134 | 135 | const char *tagName, int indent = 2) { |
| 136 | + static_assert(std::is_same<T, flagcxC2cHomoFunc>::value || |
| 137 | + std::is_same<T, flagcxC2cHeteroFunc>::value, |
| 138 | + "serializeFunc2DVector only supports flagcxC2cHomoFunc or " |
| 139 | + "flagcxC2cHeteroFunc"); |
135 | 140 | fprintf(file, "%*s<%s>\n", indent, "", tagName); |
136 | 141 | for (const auto &stepVec : steps) { |
137 | 142 | if (stepVec.size() == 0) { |
@@ -164,6 +169,10 @@ inline void readFuncStep(FILE *file, size_t chunksize, const char *line, |
164 | 169 | template <typename T> |
165 | 170 | std::vector<std::vector<T>> readFunc2DVector(FILE *file, size_t chunksize, |
166 | 171 | const char *tagName) { |
| 172 | + static_assert(std::is_same<T, flagcxC2cHomoFunc>::value || |
| 173 | + std::is_same<T, flagcxC2cHeteroFunc>::value, |
| 174 | + "readFunc2DVector only supports flagcxC2cHomoFunc or " |
| 175 | + "flagcxC2cHeteroFunc"); |
167 | 176 | std::vector<std::vector<T>> result; |
168 | 177 | char line[LINE_LEN]; |
169 | 178 |
|
|
0 commit comments