Skip to content

Commit

Permalink
Re-generate rice.hpp to pick up the string_view override for Symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonroelofs committed Aug 25, 2024
1 parent fa8430f commit 245ab01
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion include/rice/rice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6242,6 +6242,9 @@ namespace Rice
//! Construct a Symbol from an std::string.
Symbol(std::string const& s);

//! Construct a Symbol from an std::string_view.
Symbol(std::string_view const& s);

//! Return a string representation of the Symbol.
char const* c_str() const;

Expand Down Expand Up @@ -6273,7 +6276,12 @@ namespace Rice
}

inline Symbol::Symbol(std::string const& s)
: Object(detail::protect(rb_id2sym, detail::protect(rb_intern2, s.c_str(), s.size())))
: Object(detail::protect(rb_id2sym, detail::protect(rb_intern2, s.c_str(), (long)s.length())))
{
}

inline Symbol::Symbol(std::string_view const& view)
: Object(detail::protect(rb_id2sym, detail::protect(rb_intern2, view.data(), (long)view.length())))
{
}

Expand Down

0 comments on commit 245ab01

Please sign in to comment.