Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
yaml-cpp
Commits
72865f7d
Commit
72865f7d
authored
Jul 16, 2024
by
Simon Gene Gottlieb
Committed by
Jesse Beder
Nov 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove trailing return types
parent
f4bca79d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
include/yaml-cpp/fp_to_string.h
+5
-5
No files found.
include/yaml-cpp/fp_to_string.h
View file @
72865f7d
...
...
@@ -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
...
...
@@ -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
;
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment