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
4080d0b1
Unverified
Commit
4080d0b1
authored
Aug 10, 2020
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✅
add test to compile without exceptions
parent
1b28a582
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
5 deletions
+16
-5
.github/workflows/ubuntu.yml
.github/workflows/ubuntu.yml
+0
-1
include/nlohmann/ordered_map.hpp
include/nlohmann/ordered_map.hpp
+4
-2
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+5
-2
test/cmake_add_subdirectory/project/CMakeLists.txt
test/cmake_add_subdirectory/project/CMakeLists.txt
+7
-0
No files found.
.github/workflows/ubuntu.yml
View file @
4080d0b1
...
...
@@ -4,7 +4,6 @@ on: [push, pull_request]
jobs
:
build
:
runs-on
:
ubuntu-latest
steps
:
...
...
include/nlohmann/ordered_map.hpp
View file @
4080d0b1
...
...
@@ -5,6 +5,8 @@
#include <utility> // pair
#include <vector> // vector
#include <nlohmann/detail/macro_scope.hpp>
namespace
nlohmann
{
...
...
@@ -64,7 +66,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
}
}
throw
std
::
out_of_range
(
"key not found"
);
JSON_THROW
(
std
::
out_of_range
(
"key not found"
)
);
}
const
T
&
at
(
const
Key
&
key
)
const
...
...
@@ -77,7 +79,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
}
}
throw
std
::
out_of_range
(
"key not found"
);
JSON_THROW
(
std
::
out_of_range
(
"key not found"
)
);
}
size_type
erase
(
const
Key
&
key
)
...
...
single_include/nlohmann/json.hpp
View file @
4080d0b1
...
...
@@ -16395,6 +16395,9 @@ class serializer
#include <utility> // pair
#include <vector> // vector
// #include <nlohmann/detail/macro_scope.hpp>
namespace nlohmann
{
...
...
@@ -16454,7 +16457,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
}
}
throw std::out_of_range("key not found"
);
JSON_THROW(std::out_of_range("key not found")
);
}
const T& at(const Key& key) const
...
...
@@ -16467,7 +16470,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
}
}
throw std::out_of_range("key not found"
);
JSON_THROW(std::out_of_range("key not found")
);
}
size_type erase(const Key& key)
...
...
test/cmake_add_subdirectory/project/CMakeLists.txt
View file @
4080d0b1
...
...
@@ -11,3 +11,10 @@ target_link_libraries(with_namespace_target nlohmann_json::nlohmann_json)
add_executable
(
without_namespace_target main.cpp
)
target_link_libraries
(
without_namespace_target nlohmann_json
)
if
(
NOT MSVC
)
add_executable
(
without_exceptions main.cpp
)
target_link_libraries
(
without_exceptions nlohmann_json::nlohmann_json
)
target_compile_definitions
(
without_exceptions PRIVATE JSON_NOEXCEPTION
)
target_compile_options
(
without_exceptions PRIVATE -fno-exceptions
)
endif
()
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