Skip to content

Commit 7399832

Browse files
committed
Remove possible incorrect deduction in bit_writer.serialize
1 parent 6d8a211 commit 7399832

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

include/bitstream/stream/bit_writer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ namespace bitstream
390390
* @param ...args The rest of the arguments to pass to the serialize function
391391
* @return Whether successful or not
392392
*/
393-
template<typename Trait, typename... Args, typename = utility::has_serialize_t<utility::deduce_trait_t<Trait, bit_writer, Args...>, bit_writer, Trait, Args...>>
393+
template<typename... Args, typename Trait, typename = utility::has_deduce_serialize_t<Trait, bit_writer, Args...>>
394394
[[nodiscard]] bool serialize(Trait&& arg, Args&&... args) noexcept(utility::is_noexcept_serialize_v<utility::deduce_trait_t<Trait, bit_writer, Args...>, bit_writer, Trait, Args...>)
395395
{
396396
using deduce_t = utility::deduce_trait_t<Trait, bit_writer, Args...>;

include/bitstream/utility/meta.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,7 @@ namespace bitstream::utility
8686

8787
template<typename Trait, typename Stream, typename... Args>
8888
using deduce_trait_t = typename deduce_trait<void, Trait, Stream, Args...>::type;
89+
90+
template<typename Trait, typename Stream, typename... Args>
91+
using has_deduce_serialize_t = has_serialize_t<deduce_trait_t<Trait, Stream, Args...>, Stream, Trait, Args...>;
8992
}

0 commit comments

Comments
 (0)