From 7a91f471318580729b4f07103fbf217824623efd Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Thu, 21 Apr 2016 09:34:41 -0700 Subject: [PATCH] Fix definition of std::hash in C++ models Summary:stdlibc++ headers didn't like the fact that hash didn't have defined operator() directly. Do that and provide empty body. Keep inheritance in case it helps compilation to succeed. Reviewed By: dulmarod Differential Revision: D3207721 fb-gh-sync-id: 8c950da fbshipit-source-id: 8c950da --- infer/models/cpp/include/infer_model/unique_ptr.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/infer/models/cpp/include/infer_model/unique_ptr.h b/infer/models/cpp/include/infer_model/unique_ptr.h index 82d93b418..6464cc6b2 100644 --- a/infer/models/cpp/include/infer_model/unique_ptr.h +++ b/infer/models/cpp/include/infer_model/unique_ptr.h @@ -332,8 +332,10 @@ inline bool operator>=(nullptr_t, const unique_ptr<_T1, _D1>& __x) { return !(nullptr < __x); } -template -struct hash> : public hash> {}; +template +struct hash> : public hash> { + size_t operator()(const unique_ptr& __u) const noexcept {} +}; template struct _MakeUniq2 {