本文整理汇总了C++中boost::hash_value方法的典型用法代码示例。如果您正苦于以下问题:C++ boost::hash_value方法的具体用法?C++ boost::hash_value怎么用?C++ boost::hash_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost
的用法示例。
在下文中一共展示了boost::hash_value方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
std::size_t operator()(const SurfaceVertex& v) const {
using boost::hash_value;
using boost::hash_combine;
// Start with a hash value of 0 .
std::size_t seed = 0;
// Modify 'seed' by XORing and bit-shifting in
// one member of 'Key' after the other:
hash_combine(seed,hash_value(v.position[0]));
hash_combine(seed,hash_value(v.position[1]));
hash_combine(seed,hash_value(v.position[2]));
// Return the result.
return seed;
}
示例2:
locator::locator(const std::string &filename, const map_location &loc,
int center_x, int center_y, const std::string& modifications) :
val_(filename, loc, center_x, center_y, modifications)
{
hash_ = hash_value(val_);
hash1_ = hash_value1(val_);
}
示例3: operator
std::size_t operator()(const Edge<Z>& edge) const
{
using boost::hash_value;
using boost::hash_combine;
static std::hash<Z> observationHasher;
std::size_t seed = 0;
hash_combine(seed,hash_value(edge.actionIndex));
hash_combine(seed,observationHasher(edge.observation));
return seed;
}
示例4: hash_value
size_t hash_value(const locator::value& val)
{
using boost::hash_value;
using boost::hash_combine;
size_t hash = hash_value(val.type_);
if (val.type_ == locator::FILE || val.type_ == locator::SUB_FILE) {
hash_combine(hash, val.filename_);
}
if (val.type_ == locator::SUB_FILE) {
hash_combine(hash, val.loc_.x);
hash_combine(hash, val.loc_.y);
hash_combine(hash, val.center_x_);
hash_combine(hash, val.center_y_);
hash_combine(hash, val.modifications_);
}
return hash;
}
示例5: hash_value
inline size_t
hash_value (SubID const& sID)
{
return hash_value (string (sID));
}
示例6: operator
std::size_t operator()(const T& value) const {
using boost::hash_value;
return hash_value(value);
}