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

Add support to compile time non-char format #924

Merged
merged 2 commits into from
Oct 28, 2018

Conversation

XZiar
Copy link
Contributor

@XZiar XZiar commented Oct 27, 2018

PR for issue #922

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks. Just one minor comment inline.

inline typename std::enable_if<is_compile_string<S>::value, string_view>::type
to_string_view(const S &s) { return {s.data(), s.size() - 1}; }
template <typename S, typename Enable = typename std::enable_if<is_compile_string<S>::value>::type>
inline auto to_string_view(const S &s) -> basic_string_view<typename S::char_type> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to move enable_if from return type to template parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if it is possible to use S::char_type inside enable_if since S may not satisfy is_compile_string, so I choose my familiar way to implement this.

@vitaut vitaut merged commit 2dea780 into fmtlib:master Oct 28, 2018
@vitaut
Copy link
Contributor

vitaut commented Oct 28, 2018

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants