mirror of
https://github.com/OlafvdSpek/ctemplate.git
synced 2025-09-28 19:05:49 +08:00
MSVC supports std::unordered_map KeyEqual
This commit is contained in:
parent
1ba73fa183
commit
4b8476e7c2
|
@ -125,15 +125,10 @@ class @ac_windows_dllexport@ PerExpandData {
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef _MSC_VER
|
|
||||||
typedef @ac_cv_cxx_hash_map_class@<const char*, const void*, StringHash> DataMap;
|
|
||||||
#else
|
|
||||||
struct DataEq {
|
struct DataEq {
|
||||||
bool operator()(const char* s1, const char* s2) const;
|
bool operator()(const char* s1, const char* s2) const;
|
||||||
};
|
};
|
||||||
typedef @ac_cv_cxx_hash_map_class@<const char*, const void*, StringHash, DataEq>
|
typedef @ac_cv_cxx_hash_map_class@<const char*, const void*, StringHash, DataEq> DataMap;
|
||||||
DataMap;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char* annotate_path_;
|
const char* annotate_path_;
|
||||||
TemplateAnnotator* annotator_;
|
TemplateAnnotator* annotator_;
|
||||||
|
|
0
src/ctemplate/template_annotator.h.in
Executable file → Normal file
0
src/ctemplate/template_annotator.h.in
Executable file → Normal file
0
src/ctemplate/template_namelist.h.in
Executable file → Normal file
0
src/ctemplate/template_namelist.h.in
Executable file → Normal file
0
src/ctemplate/template_string.h.in
Executable file → Normal file
0
src/ctemplate/template_string.h.in
Executable file → Normal file
|
@ -42,12 +42,10 @@ namespace ctemplate {
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
|
||||||
bool PerExpandData::DataEq::operator()(const char* s1, const char* s2) const {
|
bool PerExpandData::DataEq::operator()(const char* s1, const char* s2) const {
|
||||||
return ((s1 == 0 && s2 == 0) ||
|
return ((s1 == 0 && s2 == 0) ||
|
||||||
(s1 && s2 && *s1 == *s2 && strcmp(s1, s2) == 0));
|
(s1 && s2 && *s1 == *s2 && strcmp(s1, s2) == 0));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
PerExpandData::~PerExpandData() {
|
PerExpandData::~PerExpandData() {
|
||||||
delete map_;
|
delete map_;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user