diff --git a/include/scn/detail/args.h b/include/scn/detail/args.h index 2da0f221..d84133c1 100644 --- a/include/scn/detail/args.h +++ b/include/scn/detail/args.h @@ -321,21 +321,20 @@ namespace scn { { return 0; } - template + template constexpr size_t encode_types_impl() { return static_cast( - mapped_type_constant< - T, typename Context::char_type>::value) | - (encode_types_impl() << packed_arg_bits); + mapped_type_constant::value) | + (encode_types_impl() << packed_arg_bits); } - template + template constexpr size_t encode_types() { static_assert(sizeof...(Ts) < (1 << packed_arg_bits)); return sizeof...(Ts) | - (encode_types_impl() << packed_arg_bits); + (encode_types_impl() << packed_arg_bits); } template @@ -558,6 +557,8 @@ namespace scn { : public detail::scan_arg_store_base { using base = detail::scan_arg_store_base; + using char_type = typename Context::char_type; + public: std::tuple& args() { @@ -582,11 +583,10 @@ namespace scn { static constexpr typename base::value_array_type make_data_array( A&... args) { - return {detail::make_arg, - typename Context::char_type>::value>( - args)...}; + return {detail::make_arg< + base::is_packed, Context, + detail::mapped_type_constant, + char_type>::value>(args)...}; } constexpr detail::arg_value& get_value_at(std::size_t i) @@ -605,7 +605,7 @@ namespace scn { friend class basic_scan_args; static constexpr size_t desc = - base::is_packed ? detail::encode_types() + base::is_packed ? detail::encode_types() : detail::is_unpacked_bit | base::num_args; };