mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
it's better to pass a small (e.g. 16 bytes) object by value then by const reference
This commit is contained in:
parent
3402b92ef6
commit
e46160c18e
@ -137,7 +137,7 @@ basic_string_view<typename std::remove_pointer<typename Cont::pointer>::type, dy
|
|||||||
// to_string() allow (explicit) conversions from string_view to string
|
// to_string() allow (explicit) conversions from string_view to string
|
||||||
//
|
//
|
||||||
template<class CharT, size_t Extent>
|
template<class CharT, size_t Extent>
|
||||||
std::basic_string<typename std::remove_const<CharT>::type> to_string(const basic_string_view<CharT, Extent>& view)
|
std::basic_string<typename std::remove_const<CharT>::type> to_string(basic_string_view<CharT, Extent> view)
|
||||||
{
|
{
|
||||||
return{ view.data(), view.length() };
|
return{ view.data(), view.length() };
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user