Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d9bcf52

Browse files
authored
Merge pull request simdjson#1062 from simdjson/jkeiser/reamalgamate
Fix C++ 20 compilation
2 parents 43f0362 + ed5e313 commit d9bcf52

File tree

7 files changed

+5639
-5103
lines changed

7 files changed

+5639
-5103
lines changed

‎include/simdjson/dom/array.h‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,16 @@ inline std::ostream& operator<<(std::ostream& out, const simdjson_result<dom::ar
177177
#if defined(__cpp_lib_ranges)
178178
#include <ranges>
179179

180-
namespace std::ranges {
180+
namespace std {
181+
namespace ranges {
181182
template<>
182183
inline constexpr bool enable_view<simdjson::dom::array> = true;
183-
}
184-
185-
static_assert(std::ranges::view<simdjson::dom::array>);
186-
static_assert(std::ranges::sized_range<simdjson::dom::array>);
187-
#endif
184+
#if SIMDJSON_EXCEPTIONS
185+
template<>
186+
inline constexpr bool enable_view<simdjson::simdjson_result<simdjson::dom::array>> = true;
187+
#endif // SIMDJSON_EXCEPTIONS
188+
} // namespace ranges
189+
} // namespace std
190+
#endif // defined(__cpp_lib_ranges)
188191

189192
#endif // SIMDJSON_DOM_ARRAY_H

‎include/simdjson/dom/object.h‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,16 @@ inline std::ostream& operator<<(std::ostream& out, const simdjson_result<dom::ob
284284
#if defined(__cpp_lib_ranges)
285285
#include <ranges>
286286

287-
namespace std::ranges {
287+
namespace std {
288+
namespace ranges {
288289
template<>
289290
inline constexpr bool enable_view<simdjson::dom::object> = true;
290-
}
291-
292-
static_assert(std::ranges::view<simdjson::dom::object>);
293-
static_assert(std::ranges::sized_range<simdjson::dom::object>);
294-
#endif
291+
#if SIMDJSON_EXCEPTIONS
292+
template<>
293+
inline constexpr bool enable_view<simdjson::simdjson_result<simdjson::dom::object>> = true;
294+
#endif // SIMDJSON_EXCEPTIONS
295+
} // namespace ranges
296+
} // namespace std
297+
#endif // defined(__cpp_lib_ranges)
295298

296299
#endif // SIMDJSON_DOM_OBJECT_H

‎include/simdjson/inline/array.h‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,15 @@ inline std::ostream& operator<<(std::ostream& out, const simdjson_result<dom::ar
169169

170170
} // namespace simdjson
171171

172+
#include "simdjson/inline/element.h"
173+
174+
#if defined(__cpp_lib_ranges)
175+
static_assert(std::ranges::view<simdjson::dom::array>);
176+
static_assert(std::ranges::sized_range<simdjson::dom::array>);
177+
#if SIMDJSON_EXCEPTIONS
178+
static_assert(std::ranges::view<simdjson::simdjson_result<simdjson::dom::array>>);
179+
static_assert(std::ranges::sized_range<simdjson::simdjson_result<simdjson::dom::array>>);
180+
#endif // SIMDJSON_EXCEPTIONS
181+
#endif // defined(__cpp_lib_ranges)
182+
172183
#endif // SIMDJSON_INLINE_ARRAY_H

‎include/simdjson/inline/object.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,13 @@ inline std::ostream& operator<<(std::ostream& out, const simdjson_result<dom::ob
272272

273273
} // namespace simdjson
274274

275+
#if defined(__cpp_lib_ranges)
276+
static_assert(std::ranges::view<simdjson::dom::object>);
277+
static_assert(std::ranges::sized_range<simdjson::dom::object>);
278+
#if SIMDJSON_EXCEPTIONS
279+
static_assert(std::ranges::view<simdjson::simdjson_result<simdjson::dom::object>>);
280+
static_assert(std::ranges::sized_range<simdjson::simdjson_result<simdjson::dom::object>>);
281+
#endif // SIMDJSON_EXCEPTIONS
282+
#endif // defined(__cpp_lib_ranges)
283+
275284
#endif // SIMDJSON_INLINE_OBJECT_H

‎singleheader/amalgamate_demo.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Tue 21 Jul 2020 17:54:23 EDT. Do not edit! */
1+
/* auto-generated on Tue Aug 4 13:10:22 PDT 2020. Do not edit! */
22

33
#include <iostream>
44
#include "simdjson.h"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /