Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Matthias Wittgen
variant
Commits
b39a7094
Commit
b39a7094
authored
Aug 08, 2020
by
Matthias Wittgen
Browse files
Merge branch 'dantrim' into 'master'
Change is_bool method to is_boolean to match nlohmann::json See merge request
!2
parents
749e5b58
bc1a3925
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/MsgPack.hpp
View file @
b39a7094
...
...
@@ -429,7 +429,7 @@ namespace msgpack {
if
(
v
.
is_object
())
writeObject
(
*
std
::
get
<
typename
V
::
ObjPtr
>
(
v
.
value
));
else
if
(
v
.
is_array
())
writeArray
(
*
std
::
get
<
typename
V
::
ArrayPtr
>
(
v
.
value
));
else
if
(
v
.
is_string
())
writeStr
(
*
std
::
get
<
typename
V
::
StrPtr
>
(
v
.
value
));
else
if
(
v
.
is_bool
())
writeBool
(
v
);
else
if
(
v
.
is_bool
ean
())
writeBool
(
v
);
else
if
(
v
.
is_null
())
writeNull
();
else
switch
(
v
.
index
())
{
case
V
::
Type
::
uint64
:
...
...
include/variant.hpp
View file @
b39a7094
...
...
@@ -500,7 +500,7 @@ template<typename T,
if
(
index
()
==
Type
::
uint32
)
return
std
::
get
<
uint32_t
>
(
value
);
if
(
index
()
==
Type
::
uint16
)
return
std
::
get
<
uint16_t
>
(
value
);
if
(
index
()
==
Type
::
uint8
)
return
std
::
get
<
uint8_t
>
(
value
);
if
(
is_bool
())
return
U64
(
std
::
get
<
bool
>
(
value
));
if
(
is_bool
ean
())
return
U64
(
std
::
get
<
bool
>
(
value
));
throw
;
}
...
...
@@ -511,7 +511,7 @@ template<typename T,
if
(
index
()
==
Type
::
int32
)
return
std
::
get
<
int32_t
>
(
value
);
if
(
index
()
==
Type
::
int16
)
return
std
::
get
<
int16_t
>
(
value
);
if
(
index
()
==
Type
::
int8
)
return
std
::
get
<
int8_t
>
(
value
);
if
(
is_bool
())
return
I64
(
std
::
get
<
bool
>
(
value
));
if
(
is_bool
ean
())
return
I64
(
std
::
get
<
bool
>
(
value
));
throw
;
}
...
...
@@ -521,7 +521,7 @@ template<typename T,
if
(
index
()
==
Type
::
float32
)
return
std
::
get
<
float
>
(
value
);
if
(
is_unsigned
())
return
getUint
();
if
(
is_signed
())
return
getInt
();
if
(
is_bool
())
return
DBL
(
std
::
get
<
bool
>
(
value
));
if
(
is_bool
ean
())
return
DBL
(
std
::
get
<
bool
>
(
value
));
throw
;
}
...
...
@@ -536,7 +536,7 @@ template<typename T,
bool
is_unsigned
()
const
{
return
index
()
>=
Type
::
uint64
&&
index
()
<=
Type
::
uint8
;
}
bool
is_bool
()
const
{
return
index
()
==
Type
::
boolean
;
}
bool
is_bool
ean
()
const
{
return
index
()
==
Type
::
boolean
;
}
bool
is_array
()
const
{
return
index
()
==
Type
::
array
;
}
...
...
@@ -581,7 +581,7 @@ template<typename T,
bool
result
=
false
;
using
DT
=
typename
std
::
decay
<
T
>::
type
;
if
constexpr
(
std
::
is_same
<
DT
,
bool
>::
value
)
{
if
(
is_bool
())
{
if
(
is_bool
ean
())
{
bool
lhs
=
std
::
get
<
bool
>
(
value
);
result
=
(
lhs
==
rhs
);
}
...
...
@@ -609,7 +609,7 @@ template<typename T,
bool
result
=
false
;
using
DT
=
typename
std
::
decay
<
T
>::
type
;
if
constexpr
(
std
::
is_same
<
DT
,
bool
>::
value
)
{
if
(
is_bool
())
{
if
(
is_bool
ean
())
{
bool
lhs
=
std
::
get
<
bool
>
(
value
);
result
=
(
lhs
!=
rhs
);
}
...
...
Write
Preview
Supports
Markdown
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