Commit 2b3f799f authored by Brad King's avatar Brad King

KWSys: Add hash function for std::string

Added hashing fuction for std::string.  This adds default support for
std::strings to KWSys hashing containers.

Author: Bradley Lowekamp <blowekamp@mail.nih.gov>
Suggested-by: default avatarArnaud Gelas <arnaud_gelas@hms.harvard.edu>
Change-Id: I7e7a0c356b73d19868a3df1db57b702ec7fffe9d
parent ccf9e0c4
......@@ -40,6 +40,7 @@
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <@KWSYS_NAMESPACE@/FundamentalType.h>
#include <@KWSYS_NAMESPACE@/cstddef> // size_t
#include <@KWSYS_NAMESPACE@/stl/string> // string
namespace @KWSYS_NAMESPACE@
{
......@@ -65,6 +66,16 @@ struct hash<const char*> {
size_t operator()(const char* __s) const { return _stl_hash_string(__s); }
};
@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
struct hash<@KWSYS_NAMESPACE@_stl::string> {
size_t operator()(const @KWSYS_NAMESPACE@_stl::string & __s) const { return _stl_hash_string(__s.c_str()); }
};
@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
struct hash<const @KWSYS_NAMESPACE@_stl::string> {
size_t operator()(const @KWSYS_NAMESPACE@_stl::string & __s) const { return _stl_hash_string(__s.c_str()); }
};
@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
struct hash<char> {
size_t operator()(char __x) const { return __x; }
......
......@@ -15,7 +15,7 @@
SET(KWSYS_DATE_STAMP_YEAR 2011)
# KWSys version date month component. Format is MM.
SET(KWSYS_DATE_STAMP_MONTH 08)
SET(KWSYS_DATE_STAMP_MONTH 09)
# KWSys version date day component. Format is DD.
SET(KWSYS_DATE_STAMP_DAY 20)
SET(KWSYS_DATE_STAMP_DAY 01)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment