Skip to content

Commit

Permalink
Merge pull request #338 from beached/v3
Browse files Browse the repository at this point in the history
version bump and formatting fix
  • Loading branch information
beached authored Nov 2, 2022
2 parents 1e89e9e + 9e87e05 commit 713f2f3
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
cmake_minimum_required( VERSION 3.14 )

project( "daw-json-link"
VERSION "3.3.1"
VERSION "3.3.2"
DESCRIPTION "Static JSON parsing in C++"
HOMEPAGE_URL "https://github.com/beached/daw_json_link"
LANGUAGES C CXX )
Expand Down
1 change: 0 additions & 1 deletion include/daw/json/daw_json_event_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ namespace daw::json {
JsonEventParserStackValue<ParseState::policy_flags( ), A>;
auto jvalue = basic_json_value( bjv );


auto parent_stack = [] {
if constexpr( std::is_same_v<StackContainerPolicy, use_default> ) {
return DefaultJsonEventParserStackPolicy<stack_value_t>{ };
Expand Down
3 changes: 2 additions & 1 deletion include/daw/json/impl/daw_json_parse_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ namespace daw::json {
( JsonMembers::must_be_class_member or ... ) )>;

// MSVC in C++20 mode has a bug. This works around it
#if (not defined( _MSC_VER ) or __cpp_constexpr <= 201700L) or defined( __clang__ )
#if( not defined( _MSC_VER ) or __cpp_constexpr <= 201700L ) or \
defined( __clang__ )
auto known_locations = DAW_AS_CONSTANT(
( make_locations_info<ParseState, JsonMembers...>( ) ) );
#else
Expand Down
11 changes: 6 additions & 5 deletions include/daw/json/impl/daw_json_parse_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ namespace daw::json {
}

template<typename T>
inline constexpr JsonParseTypes
number_parse_type_impl_v = number_parse_type_impl_test<T>( );
inline constexpr JsonParseTypes number_parse_type_impl_v =
number_parse_type_impl_test<T>( );

template<typename T>
constexpr auto number_parse_type_test( )
Expand All @@ -393,8 +393,8 @@ namespace daw::json {
}

template<typename T>
inline constexpr JsonParseTypes
number_parse_type_v = number_parse_type_test<T>( );
inline constexpr JsonParseTypes number_parse_type_v =
number_parse_type_test<T>( );

template<typename, typename = void>
struct json_deduced_type_map {
Expand Down Expand Up @@ -849,7 +849,8 @@ Constructor{ }( std::declval<typename Members::parse_to_t &&>( )... ) );*/
[[nodiscard]] DAW_ATTRIB_INLINE constexpr auto
construct_nullable_empty( ) {
if constexpr( std::is_invocable_v<
Constructor, concepts::construct_nullable_with_empty_t> ) {
Constructor,
concepts::construct_nullable_with_empty_t> ) {
return Constructor{ }( concepts::construct_nullable_with_empty );
} else {
return Constructor{ }( );
Expand Down
4 changes: 2 additions & 2 deletions include/daw/json/impl/daw_json_parse_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,8 @@ namespace daw::json {
/// parse_options.md
///
template<auto... PolicyFlags>
inline constexpr auto
parse_flags = details::make_parse_flags<PolicyFlags...>( );
inline constexpr auto parse_flags =
details::make_parse_flags<PolicyFlags...>( );
} // namespace options

#define DAW_JSON_CONFORMANCE_FLAGS \
Expand Down
10 changes: 5 additions & 5 deletions include/daw/json/impl/daw_json_parse_real_power10.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ namespace daw::json {
std::numeric_limits<double>::max_exponent10;

template<typename Result>
inline constexpr int
max_exp = std::is_same_v<Result, float>
? ( std::min )( max_dbl_exp,
std::numeric_limits<float>::max_exponent10 )
: max_dbl_exp;
inline constexpr int max_exp =
std::is_same_v<Result, float>
? ( std::min )( max_dbl_exp,
std::numeric_limits<float>::max_exponent10 )
: max_dbl_exp;

template<typename Result, typename Unsigned>
DAW_ATTRIB_FLATINLINE static inline constexpr Result
Expand Down
4 changes: 2 additions & 2 deletions include/daw/json/impl/daw_json_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ namespace daw::json {

template<typename T>
inline constexpr bool is_string_view_like_v =
daw::is_detected_v<is_string_like_impl::has_data_test, T>
and daw::is_detected_v<is_string_like_impl::has_size_test, T>;
daw::is_detected_v<is_string_like_impl::has_data_test, T> and
daw::is_detected_v<is_string_like_impl::has_size_test, T>;

static_assert( is_string_view_like_v<std::string_view> );

Expand Down
10 changes: 4 additions & 6 deletions include/daw/json/impl/daw_json_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ namespace daw::json {
BasicParsePolicy<PolicyFlags, Allocator> const & )
-> basic_json_value_iterator<PolicyFlags, Allocator>;

basic_json_value_iterator( daw::string_view )
-> basic_json_value_iterator<>;
basic_json_value_iterator( daw::string_view )->basic_json_value_iterator<>;

template<typename Allocator>
basic_json_value_iterator( daw::string_view, Allocator const & )
Expand Down Expand Up @@ -674,12 +673,11 @@ namespace daw::json {
basic_json_value( BasicParsePolicy<PolicyFlags, Allocator> )
-> basic_json_value<PolicyFlags, Allocator>;

basic_json_value( daw::string_view ) -> basic_json_value<>;
basic_json_value( daw::string_view )->basic_json_value<>;

basic_json_value( char const *first, std::size_t sz ) -> basic_json_value<>;
basic_json_value( char const *first, std::size_t sz )->basic_json_value<>;

basic_json_value( char const *first, char const *last )
-> basic_json_value<>;
basic_json_value( char const *first, char const *last )->basic_json_value<>;

template<typename Result, json_options_t PolicyFlags, typename Allocator>
[[nodiscard]] constexpr Result
Expand Down

0 comments on commit 713f2f3

Please sign in to comment.