Skip to content

Commit dea0181

Browse files
ZJUGuoShuaicliffburdick
authored andcommitted
prefer const auto rather than auto
1 parent d750191 commit dea0181

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/matx/core/tensor_utils.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -513,19 +513,19 @@ namespace detail {
513513
using namespace std::literals::string_literals;
514514

515515
if constexpr (is_complex_v<T>) {
516-
auto prec = std::to_string(PRINT_PRECISION);
517-
auto fmt_s = ("%."s + prec + "e%+." + prec + "ej ").c_str();
516+
const auto prec = std::to_string(PRINT_PRECISION);
517+
const auto fmt_s = ("%."s + prec + "e%+." + prec + "ej ").c_str();
518518
printf(fmt_s, static_cast<float>(val.real()),
519519
static_cast<float>(val.imag()));
520520
}
521521
else if constexpr (is_matx_half_v<T> || is_half_v<T>) {
522-
auto prec = std::to_string(PRINT_PRECISION);
523-
auto fmt_s = ("%."s + prec + "e ").c_str();
522+
const auto prec = std::to_string(PRINT_PRECISION);
523+
const auto fmt_s = ("%."s + prec + "e ").c_str();
524524
printf(fmt_s, static_cast<float>(val));
525525
}
526526
else if constexpr (std::is_floating_point_v<T>) {
527-
auto prec = std::to_string(PRINT_PRECISION);
528-
auto fmt_s = ("%."s + prec + "e ").c_str();
527+
const auto prec = std::to_string(PRINT_PRECISION);
528+
const auto fmt_s = ("%."s + prec + "e ").c_str();
529529
printf(fmt_s, val);
530530
}
531531
else if constexpr (std::is_same_v<T, long long int>) {

0 commit comments

Comments
 (0)