Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
b1fe6ee0
Unverified
Commit
b1fe6ee0
authored
Apr 28, 2020
by
Niels Lohmann
Committed by
GitHub
Apr 28, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2069 from nlohmann/issue2064
Fix returning reference to local temporary object
parents
d9d1279a
9e0180b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
include/nlohmann/json.hpp
include/nlohmann/json.hpp
+12
-0
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+12
-0
test/src/unit-constructor1.cpp
test/src/unit-constructor1.cpp
+1
-1
No files found.
include/nlohmann/json.hpp
View file @
b1fe6ee0
...
...
@@ -2757,6 +2757,18 @@ class basic_json
return
is_binary
()
?
m_value
.
binary
:
nullptr
;
}
/// get a pointer to the value (binary)
internal_binary_t
*
get_impl_ptr
(
internal_binary_t
*
/*unused*/
)
noexcept
{
return
is_binary
()
?
m_value
.
binary
:
nullptr
;
}
/// get a pointer to the value (binary)
constexpr
const
internal_binary_t
*
get_impl_ptr
(
const
internal_binary_t
*
/*unused*/
)
const
noexcept
{
return
is_binary
()
?
m_value
.
binary
:
nullptr
;
}
/*!
@brief helper function to implement get_ref()
...
...
single_include/nlohmann/json.hpp
View file @
b1fe6ee0
...
...
@@ -18243,6 +18243,18 @@ class basic_json
return
is_binary
()
?
m_value
.
binary
:
nullptr
;
}
/// get a pointer to the value (binary)
internal_binary_t
*
get_impl_ptr
(
internal_binary_t
*
/*unused*/
)
noexcept
{
return
is_binary
()
?
m_value
.
binary
:
nullptr
;
}
/// get a pointer to the value (binary)
constexpr
const
internal_binary_t
*
get_impl_ptr
(
const
internal_binary_t
*
/*unused*/
)
const
noexcept
{
return
is_binary
()
?
m_value
.
binary
:
nullptr
;
}
/*!
@brief helper function to implement get_ref()
...
...
test/src/unit-constructor1.cpp
View file @
b1fe6ee0
...
...
@@ -826,7 +826,7 @@ TEST_CASE("constructors")
// check that NaN is serialized to null
CHECK
(
j
.
dump
()
==
"null"
);
}
}
SECTION
(
"infinity"
)
{
...
...
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