Skip to content

Commit cf18012

Browse files
committed
Fixed bug with json.h on linux
1 parent 72e0cce commit cf18012

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Release/include/cpprest/json.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -851,17 +851,22 @@ namespace web { namespace json
851851
if (!m_sorted)
852852
{
853853
sort(m_elements.begin(), m_elements.end(),
854-
[] (std::pair<utility::string_t,value>& a, std::pair<utility::string_t, value>& b) { return a.first < b.first;});
854+
[] (const std::pair<utility::string_t,value>& a,
855+
const std::pair<utility::string_t, value>& b)
856+
{
857+
return a.first < b.first;
858+
});
855859
m_sorted = true;
856860
}
857861

858862
std::pair<utility::string_t, value> val = std::pair<utility::string_t, value>(key, value());
859863

860864
auto iter = std::lower_bound(m_elements.begin(), m_elements.end(), val,
861-
[] (const std::pair<utility::string_t, value>& p1, const std::pair<utility::string_t, value>& p2)
862-
{
863-
return p1.first < p2.first;
864-
});
865+
[] (const std::pair<utility::string_t, value>& p1,
866+
const std::pair<utility::string_t, value>& p2)
867+
{
868+
return p1.first < p2.first;
869+
});
865870

866871
if (iter == m_elements.end() || key != (iter->first))
867872
return m_elements.insert(iter, val)->second;

0 commit comments

Comments
 (0)