Skip to content
Snippets Groups Projects
Commit 61b1093d authored by Jan Trávníček's avatar Jan Trávníček
Browse files

std: use static cast in strig view creation

parent 122a7cdc
No related branches found
No related tags found
1 merge request!179C casts to C++ casts redesign
...@@ -440,7 +440,7 @@ inline std::string_view trim ( std::string_view s ) { ...@@ -440,7 +440,7 @@ inline std::string_view trim ( std::string_view s ) {
// Creates a string view from a pair of iterators // Creates a string view from a pair of iterators
// http://stackoverflow.com/q/33750600/882436 // http://stackoverflow.com/q/33750600/882436
inline std::string_view make_string_view ( std::string::const_iterator begin, std::string::const_iterator end ) { inline std::string_view make_string_view ( std::string::const_iterator begin, std::string::const_iterator end ) {
return std::string_view { ( begin != end ) ? & * begin : nullptr, ( typename std::string_view::size_type ) std::max ( std::distance ( begin, end ), ( typename std::string_view::difference_type ) 0 ) }; return std::string_view { ( begin != end ) ? & * begin : nullptr, static_cast < std::string_view::size_type > ( std::max ( std::distance ( begin, end ), static_cast < typename std::string_view::difference_type > ( 0 ) ) ) };
} // make_string_view } // make_string_view
   
} /* namespace ext */ } /* namespace ext */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment