[libcxx] r347765 - [libcxx] Apply _LIBCPP_INLINE_VISIBILITY for std::hash for string_view

Louis Dionne ldionne at apple.com
Wed Nov 28 07:22:30 PST 2018


Author: ldionne
Date: Wed Nov 28 07:22:30 2018
New Revision: 347765

URL: http://llvm.org/viewvc/llvm-project?rev=347765&view=rev
Log:
[libcxx] Apply _LIBCPP_INLINE_VISIBILITY for std::hash for string_view

Modified:
    libcxx/trunk/include/string_view

Modified: libcxx/trunk/include/string_view
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/string_view?rev=347765&r1=347764&r2=347765&view=diff
==============================================================================
--- libcxx/trunk/include/string_view (original)
+++ libcxx/trunk/include/string_view Wed Nov 28 07:22:30 2018
@@ -778,17 +778,12 @@ template<class _CharT, class _Traits>
 struct _LIBCPP_TEMPLATE_VIS hash<basic_string_view<_CharT, _Traits> >
     : public unary_function<basic_string_view<_CharT, _Traits>, size_t>
 {
-    size_t operator()(const basic_string_view<_CharT, _Traits> __val) const _NOEXCEPT;
+    _LIBCPP_INLINE_VISIBILITY
+    size_t operator()(const basic_string_view<_CharT, _Traits> __val) const _NOEXCEPT {
+        return __do_string_hash(__val.data(), __val.data() + __val.size());
+    }
 };
 
-template<class _CharT, class _Traits>
-size_t
-hash<basic_string_view<_CharT, _Traits> >::operator()(
-        const basic_string_view<_CharT, _Traits> __val) const _NOEXCEPT
-{
-    return __do_string_hash(__val.data(), __val.data() + __val.size());
-}
-
 
 #if _LIBCPP_STD_VER > 11 
 inline namespace literals




More information about the libcxx-commits mailing list