Skip to content

Commit

Permalink
fix: remove trailing return types
Browse files Browse the repository at this point in the history
  • Loading branch information
SGSSGene committed Jul 18, 2024
1 parent 25fc7a7 commit 1fe5866
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/yaml-cpp/fp_to_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace fp_formatting {
* assert(buffer[1] == '2');
* assert(buffer[2] == '3');
*/
inline auto ConvertToChars(char* begin, char* end, size_t value, int width=1) -> int {
inline int ConvertToChars(char* begin, char* end, size_t value, int width=1) {
assert(width >= 1);
assert(end >= begin); // end must be after begin
assert(end-begin >= width); // Buffer must be large enough
Expand Down Expand Up @@ -62,7 +62,7 @@ inline auto ConvertToChars(char* begin, char* end, size_t value, int width=1) ->
* converts a value 'v' to a string. Uses dragonbox for formatting.
*/
template <typename T>
auto FpToString(T v, int precision = 0) -> std::string {
std::string FpToString(T v, int precision = 0) {
// assert(precision > 0);
// hardcoded constant, at which exponent should switch to a scientific notation
int const lowerExponentThreshold = -5;
Expand Down Expand Up @@ -184,18 +184,18 @@ auto FpToString(T v, int precision = 0) -> std::string {
}
}

inline auto FpToString(float v, size_t precision = 0) -> std::string {
inline std::string FpToString(float v, size_t precision = 0) {
return detail::fp_formatting::FpToString(v, precision);
}

inline auto FpToString(double v, size_t precision = 0) -> std::string {
inline std::string FpToString(double v, size_t precision = 0) {
return detail::fp_formatting::FpToString(v, precision);
}

/**
* dragonbox only works for floats/doubles not long double
*/
inline auto FpToString(long double v, size_t precision = std::numeric_limits<long double>::max_digits10) -> std::string {
inline std::string FpToString(long double v, size_t precision = std::numeric_limits<long double>::max_digits10) {
std::stringstream ss;
ss.imbue(std::locale("C"));
ss.precision(precision);
Expand Down

0 comments on commit 1fe5866

Please sign in to comment.