Skip to content
Snippets Groups Projects
Commit 79c2cd63 authored by Adam Wardynski's avatar Adam Wardynski
Browse files

Looks like there's no conversion between const char* and...

Looks like there's no conversion between const char* and string::const_iterator on MSVC (actually it sounds safer if you ask me). Anyway, working around that by wrapping const char* around a std::string
parent 8ab29541
Branches
No related tags found
No related merge requests found
...@@ -280,7 +280,12 @@ Tag Tagset::make_tag(idx_t pos_idx, mask_t values, bool allow_extra) const ...@@ -280,7 +280,12 @@ Tag Tagset::make_tag(idx_t pos_idx, mask_t values, bool allow_extra) const
Tag Tagset::make_ign_tag() const Tag Tagset::make_ign_tag() const
{ {
#ifndef _MSC_VER
mask_t ign_pos_mask = get_pos_mask("ign"); mask_t ign_pos_mask = get_pos_mask("ign");
#else //no const char* to std::string::const_iterator conversion
static const std::string ign("ign");
mask_t ign_pos_mask = get_pos_mask(ign);
#endif
assert(ign_pos_mask.any()); assert(ign_pos_mask.any());
return Tag(ign_pos_mask); return Tag(ign_pos_mask);
} }
......
...@@ -135,7 +135,11 @@ public: ...@@ -135,7 +135,11 @@ public:
*/ */
void parse_tag(const char* c, bool allow_extra, void parse_tag(const char* c, bool allow_extra,
boost::function<void (const Tag&)> sink) const { boost::function<void (const Tag&)> sink) const {
#ifndef _MSC_VER
parse_tag(std::make_pair(c, c + strlen(c)), allow_extra, sink); parse_tag(std::make_pair(c, c + strlen(c)), allow_extra, sink);
#else // no const char* to std::string::const_iterator conversion
parse_tag(std::string(c), allow_extra, sink);
#endif
} }
/** /**
...@@ -174,7 +178,11 @@ public: ...@@ -174,7 +178,11 @@ public:
* version. * version.
*/ */
std::vector<Tag> parse_tag(const char* c, bool allow_extra) const { std::vector<Tag> parse_tag(const char* c, bool allow_extra) const {
#ifndef _MSC_VER
return parse_tag(std::make_pair(c, c + strlen(c)), allow_extra); return parse_tag(std::make_pair(c, c + strlen(c)), allow_extra);
#else // no const char* to std::string::const_iterator conversion
return parse_tag(std::string(c), allow_extra);
#endif
} }
/** /**
...@@ -201,8 +209,12 @@ public: ...@@ -201,8 +209,12 @@ public:
* version. * version.
*/ */
Tag parse_simple_tag(const char* c, bool allow_extra) const { Tag parse_simple_tag(const char* c, bool allow_extra) const {
#ifndef _MSC_VER
return parse_simple_tag(std::make_pair(c, c + strlen(c)), return parse_simple_tag(std::make_pair(c, c + strlen(c)),
allow_extra); allow_extra);
#else // no const char* to std::string::const_iterator conversion
return parse_simple_tag(std::string(c), allow_extra);
#endif
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment