mirror of
https://github.com/nlohmann/json.git
synced 2026-11-06 04:39:20 +00:00
json_view: accept() checks the text without writing an index (#5970)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
1 parent
76001c6b4c
commit
1a018577cc
9 files changed
+500
-83
No files matched your search
@@ -40,6 +40,15 @@
|
||||
#define NLOHMANN_VIEW_NOINLINE
|
||||
#endif
|
||||
|
||||
// GCC: a function compiled as written, without the clones in which interprocedural
|
||||
// constant propagation drops an argument that every caller passes as the same constant
|
||||
// (calling such a clone changes the code GCC generates for the parse loop that calls it)
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#define NLOHMANN_VIEW_NOCLONE __attribute__((noclone))
|
||||
#else
|
||||
#define NLOHMANN_VIEW_NOCLONE
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define NLOHMANN_VIEW_NODISCARD __attribute__((warn_unused_result))
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
Reference in new issue
Block a user