Skip to content

Commit

Permalink
constexpr the literal_string -> String conversion
Browse files Browse the repository at this point in the history
Summary: For example, this is useful for `literal_string` -> `string_piece` in compile-time code.

Reviewed By: yfeldblum

Differential Revision: D59405665

fbshipit-source-id: cbafdd66ade0fbd2b646d151f9e1e7312a41c562
  • Loading branch information
snarkmaster authored and facebook-github-bot committed Jul 8, 2024
1 parent 5086dcc commit 06a8ff6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion folly/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ struct literal_string {
template <
typename String,
decltype((void(String(FOLLY_DECLVAL(C const*), N - 1)), 0)) = 0>
explicit operator String() const //
constexpr explicit operator String() const //
noexcept(noexcept(String(FOLLY_DECLVAL(C const*), N - 1))) {
return String(data(), N - 1);
}
Expand Down

0 comments on commit 06a8ff6

Please sign in to comment.