2525using Benchmarks::arithmetic_float;
2626using Benchmarks::BenchArgs;
2727
28+ #if FROM_CHARS_SUPPORTED
2829template <arithmetic_float T>
2930void evaluateProperties (const std::vector<T> &lines,
3031 const std::array<BenchArgs<T>, Benchmarks::COUNT> &args) {
@@ -49,7 +50,6 @@ void evaluateProperties(const std::vector<T> &lines,
4950 assert (ptr == bufRef.data () + vRef);
5051 assert (ec == std::errc ());
5152 assert (d == dRef);
52-
5353 // Tested algorithm output
5454 const int vAlgo = algo.func (d, bufAlgo);
5555 bufAlgo[vAlgo] = ' \0 ' ;
@@ -64,6 +64,7 @@ void evaluateProperties(const std::vector<T> &lines,
6464 fmt::println (" {:20} {:20}" , algo.name , incorrect == 0 ? " yes" : " no" );
6565 }
6666}
67+ #endif // FROM_CHARS_SUPPORTED
6768
6869template <arithmetic_float T>
6970void process (const std::vector<T> &lines,
@@ -139,10 +140,12 @@ int main(int argc, char **argv) {
139140 " m,model" , " Random Model." ,
140141 cxxopts::value<std::string>()->default_value (" uniform" ))(
141142 " s,single" , " Use single precision instead of double." ,
142- cxxopts::value<bool >()->default_value (" false" ))(
143- " t,test" , " Test the algorithms and find their properties." ,
144- cxxopts::value<bool >()->default_value (" false" ))(
145- " d,dragon" , " Enable dragon4 (current impl. triggers some asserts)." ,
143+ cxxopts::value<bool >()->default_value (" false" ))
144+ #if FROM_CHARS_SUPPORTED
145+ (" t,test" , " Test the algorithms and find their properties." ,
146+ cxxopts::value<bool >()->default_value (" false" ))
147+ #endif // FROM_CHARS_SUPPORTED
148+ (" d,dragon" , " Enable dragon4 (current impl. triggers some asserts)." ,
146149 cxxopts::value<bool >()->default_value (" false" ))(
147150 " e,errol" , " Enable errol3 (current impl. returns invalid values, e.g., for 0)." ,
148151 cxxopts::value<bool >()->default_value (" false" ))(
@@ -211,9 +214,11 @@ int main(int argc, char **argv) {
211214 using T1 = typename std::decay_t <decltype (lines)>::value_type;
212215 using T2 = typename std::decay_t <decltype (args)>::value_type::Type;
213216 if constexpr (std::is_same_v<T1, T2>) {
217+ #if FROM_CHARS_SUPPORTED
214218 if (test)
215219 evaluateProperties (lines, args);
216220 else
221+ #endif // FROM_CHARS_SUPPORTED
217222 process (lines, args);
218223 }
219224 }, numbers, algorithms);
0 commit comments