Skip to content

Commit

Permalink
sstring: declare nested type with typename
Browse files Browse the repository at this point in the history
per [temp.dep.type](https://eel.is/c++draft/temp.dep.type#5),
`string_type::value_type` is considered a qualified name, and is
a dependent type, so we have to prefix it with `typename` to make
sure the compiler consider it as a type.

Fixes scylladb#2327
Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Jul 6, 2024
1 parent dcd0d1b commit a7ac35d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/seastar/core/sstring.hh
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ string_type uninitialized_string(size_t size) {
} else {
string_type ret;
#ifdef __cpp_lib_string_resize_and_overwrite
ret.resize_and_overwrite(size, [](string_type::value_type*, string_type::size_type n) { return n; });
ret.resize_and_overwrite(size, [](typename string_type::value_type*, typename string_type::size_type n) { return n; });
#else
ret.resize(size);
#endif
Expand Down

0 comments on commit a7ac35d

Please sign in to comment.