Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3410708

Browse files
committed
Merge pull request#565 from mistafunk/0.11-devel
workaround for "incompatible string iterator" assertion triggered by default-constructed string iterators
2 parents6d340b2 +7bb35da commit3410708

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Testing
99
libs/mime/test/mime-roundtrip
1010
*.a
1111
_build
12+
/.project

‎boost/network/uri/uri.hpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,44 +108,60 @@ class BOOST_URI_DECL uri {
108108
return uri_parts_.fragment ? uri_parts_.fragment.get() :const_range_type();
109109
}
110110

111+
// hackfix by Simon Haegler, Esri R&D Zurich
112+
// this workaround is needed to avoid running into the "incompatible string iterator" assertion
113+
// triggered by the default-constructed string iterators employed by cpp-netlib (see uri.ipp qi::rule declarations)
114+
#if defined(_MSC_VER) && defined(_DEBUG)
115+
#defineCATCH_EMPTY_ITERATOR_RANGEif (range.begin()._Getcont() ==0 || range.end()._Getcont() ==0) {returnstring_type(); }
116+
#else
117+
#defineCATCH_EMPTY_ITERATOR_RANGE
118+
#endif
119+
111120
string_typescheme()const {
112121
const_range_type range =scheme_range();
113-
return range ?string_type(boost::begin(range),boost::end(range))
122+
CATCH_EMPTY_ITERATOR_RANGE
123+
return range ?string_type(boost::begin(range),boost::end(range))
114124
:string_type();
115125
}
116126

117127
string_typeuser_info()const {
118128
const_range_type range =user_info_range();
129+
CATCH_EMPTY_ITERATOR_RANGE
119130
return range ?string_type(boost::begin(range),boost::end(range))
120131
:string_type();
121132
}
122133

123134
string_typehost()const {
124135
const_range_type range =host_range();
136+
CATCH_EMPTY_ITERATOR_RANGE
125137
return range ?string_type(boost::begin(range),boost::end(range))
126138
:string_type();
127139
}
128140

129141
string_typeport()const {
130142
const_range_type range =port_range();
143+
CATCH_EMPTY_ITERATOR_RANGE
131144
return range ?string_type(boost::begin(range),boost::end(range))
132145
:string_type();
133146
}
134147

135148
string_typepath()const {
136149
const_range_type range =path_range();
150+
CATCH_EMPTY_ITERATOR_RANGE
137151
return range ?string_type(boost::begin(range),boost::end(range))
138152
:string_type();
139153
}
140154

141155
string_typequery()const {
142156
const_range_type range =query_range();
157+
CATCH_EMPTY_ITERATOR_RANGE
143158
return range ?string_type(boost::begin(range),boost::end(range))
144159
:string_type();
145160
}
146161

147162
string_typefragment()const {
148163
const_range_type range =fragment_range();
164+
CATCH_EMPTY_ITERATOR_RANGE
149165
return range ?string_type(boost::begin(range),boost::end(range))
150166
:string_type();
151167
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp