|
||||
File indexing completed on 2025-01-18 09:53:32
0001 //----------------------------------------------------------------------------- 0002 // boost variant/detail/std_hash.hpp header file 0003 // See http://www.boost.org for updates, documentation, and revision history. 0004 //----------------------------------------------------------------------------- 0005 // 0006 // Copyright (c) 2018-2023 Antony Polukhin 0007 // 0008 // Distributed under the Boost Software License, Version 1.0. (See 0009 // accompanying file LICENSE_1_0.txt or copy at 0010 // http://www.boost.org/LICENSE_1_0.txt) 0011 0012 0013 #ifndef BOOST_VARIANT_DETAIL_STD_HASH_HPP 0014 #define BOOST_VARIANT_DETAIL_STD_HASH_HPP 0015 0016 #include <boost/config.hpp> 0017 #ifdef BOOST_HAS_PRAGMA_ONCE 0018 # pragma once 0019 #endif 0020 0021 #include <boost/variant/variant_fwd.hpp> 0022 #include <boost/variant/detail/hash_variant.hpp> 0023 0024 /////////////////////////////////////////////////////////////////////////////// 0025 // macro BOOST_VARIANT_DO_NOT_SPECIALIZE_STD_HASH 0026 // 0027 // Define this macro if you do not wish to have a std::hash specialization for 0028 // boost::variant. 0029 0030 #if !defined(BOOST_VARIANT_DO_NOT_SPECIALIZE_STD_HASH) && !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) 0031 0032 #include <functional> // for std::hash 0033 0034 namespace std { 0035 template < BOOST_VARIANT_ENUM_PARAMS(typename T) > 0036 struct hash<boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) > > { 0037 std::size_t operator()(const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >& val) const { 0038 return ::boost::hash_value(val); 0039 } 0040 }; 0041 } 0042 0043 #endif // #if !defined(BOOST_VARIANT_DO_NOT_SPECIALIZE_STD_HASH) && !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) 0044 0045 #endif // BOOST_VARIANT_DETAIL_STD_HASH_HPP 0046
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |