repr
0.1
Reconstructable string representations and more
Toggle main menu visibility
Main Page
Installation
Usage
Customization
Extending
FAQ
CI Results
Test
Benchmark
API Documentation
Namespace List
Namespace List
Namespace Members
All
_
a
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
Functions
_
a
c
d
e
f
g
i
l
m
n
o
r
s
t
u
v
w
Variables
Typedefs
Enumerations
Concept List
Class List
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
_
a
c
e
f
g
i
l
m
n
o
p
r
s
t
v
w
~
Variables
a
b
c
d
e
f
g
i
k
l
m
n
o
p
q
r
s
t
u
v
Typedefs
a
c
d
e
f
g
h
l
m
p
r
s
t
u
v
w
Enumerations
Enumerator
Related Symbols
File List
File List
File Members
All
_
l
n
o
r
u
Variables
Macros
_
l
o
r
u
Examples
Source Code
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Concepts
Loading...
Searching...
No Matches
fundamental.h
Go to the documentation of this file.
#pragma once
#include <
string
>
#include <
cmath
>
#include <
librepr/macro/format.h
>
namespace
librepr
{
// Boolean type
inline
std::string
repr
(
bool
obj
) {
return
obj
?
"true"
:
"false"
;
}
inline
std::string
repr
(
bool
obj
) {
…
}
// Integer types
inline
std::string
repr
(
signed
short
obj
) {
return
REPR_FORMAT
(
"{}"
,
obj
);
}
inline
std::string
repr
(
signed
short
obj
) {
…
}
inline
std::string
repr
(
unsigned
short
obj
) {
return
REPR_FORMAT
(
"{}"
,
obj
);
}
inline
std::string
repr
(
unsigned
short
obj
) {
…
}
inline
std::string
repr
(
signed
int
obj
) {
return
REPR_FORMAT
(
"{}"
,
obj
);
}
inline
std::string
repr
(
signed
int
obj
) {
…
}
inline
std::string
repr
(
unsigned
int
obj
) {
return
REPR_FORMAT
(
"{}U"
,
obj
);
}
inline
std::string
repr
(
unsigned
int
obj
) {
…
}
inline
std::string
repr
(
signed
long
obj
) {
return
REPR_FORMAT
(
"{}L"
,
obj
);
}
inline
std::string
repr
(
signed
long
obj
) {
…
}
inline
std::string
repr
(
unsigned
long
obj
) {
return
REPR_FORMAT
(
"{}UL"
,
obj
);
}
inline
std::string
repr
(
unsigned
long
obj
) {
…
}
inline
std::string
repr
(
signed
long
long
obj
) {
return
REPR_FORMAT
(
"{}LL"
,
obj
);
}
inline
std::string
repr
(
signed
long
long
obj
) {
…
}
inline
std::string
repr
(
unsigned
long
long
obj
) {
return
REPR_FORMAT
(
"{}ULL"
,
obj
);
}
inline
std::string
repr
(
unsigned
long
long
obj
) {
…
}
// Floating-point types
inline
std::string
repr
(
float
obj
) {
auto
is_integer
=
rintf
(
obj
) ==
obj
;
return
REPR_FORMAT
(
"{}{}F"
,
obj
,
is_integer
?
".0"
:
""
);
}
inline
std::string
repr
(
float
obj
) {
…
}
inline
std::string
repr
(
double
obj
) {
auto
is_integer
= rint(
obj
) ==
obj
;
return
REPR_FORMAT
(
"{}{}"
,
obj
,
is_integer
?
".0"
:
""
);
}
inline
std::string
repr
(
double
obj
) {
…
}
inline
std::string
repr
(
long
double
obj
) {
auto
is_integer
=
rintl
(
obj
) ==
obj
;
return
REPR_FORMAT
(
"{}{}L"
,
obj
,
is_integer
?
".0"
:
""
);
}
inline
std::string
repr
(
long
double
obj
) {
…
}
// Character types
inline
std::string
repr
(
char
obj
) {
return
REPR_FORMAT
(
"'{:c}'"
,
obj
);
}
inline
std::string
repr
(
char
obj
) {
…
}
}
// namespace librepr
include
librepr
repr
fundamental.h
Generated by
1.9.8, using the excellent
Doxygen Awesome
Theme