Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codec std::string support custom Allocator? #524

Closed
AhdaiDawn opened this issue Aug 16, 2024 · 2 comments · Fixed by #525
Closed

Codec std::string support custom Allocator? #524

AhdaiDawn opened this issue Aug 16, 2024 · 2 comments · Fixed by #525
Labels
enhancement New feature or request

Comments

@AhdaiDawn
Copy link

template <typename T> struct is_std_string : std::false_type
{
};
template <typename Allocator>
struct is_std_string<std::basic_string<char, std::char_traits<char>, Allocator>> : std::true_type
{
};
// ...
else if constexpr (std::disjunction_v<is_std_string, std::is_same<Arg, std::string_view>>) 
// ...

else if constexpr (std::disjunction_v<std::is_same<Arg, std::string>, std::is_same<Arg, std::string_view>>)

@odygrd
Copy link
Owner

odygrd commented Aug 16, 2024

Hey thanks for reporting!
I will add it in the next release.
As a workaround for now you can pass a string view or string.data()

@odygrd odygrd added the enhancement New feature or request label Aug 16, 2024
@AhdaiDawn AhdaiDawn reopened this Aug 16, 2024
@odygrd odygrd reopened this Aug 16, 2024
@odygrd
Copy link
Owner

odygrd commented Aug 16, 2024

Let’s leave it open for now, i will close it once implemented :)

@odygrd odygrd linked a pull request Aug 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants