1. Problems on
Windows:
We have the
following piece of code that uses boost (copy/paste):
#include
"boost/regex.h"
#include "boost/regex.hpp"
using namespace
boost;
using namespace std;
typedef
boost::reg_expression<char> re_type;
typedef re_type::allocator_type
allocator_type;
long example_func(long pos, const std::string&
regE, long& reslen, long max)
{
long res;
boost::match_results <PData::iterator, allocator_type>
m;
allocator_type (a);
re_type e (a);
e.set_expression (regE, regbase::normal);
if (regex_search (begin (), end (), m, e,
match_not_dot_newline |
match_not_dot_null))
<-- line 4790
{
res = pos +
m.position();
reslen = m.length();
return res;
}
.
.
.
Compiling the above
produce the following error:
parser.cpp
z:\n2_3rd_party_components\boost\delivery\include\boost\regex\v4\perl_matcher_common.hpp(208)
: error C2228: left of '.second' must have class/struct/union
type
type is 'const
std::allocator<_Ty>::value_type'
with
[
_Ty=char
]
z:\n2_3rd_party_components\boost\delivery\include\boost\regex\v4\basic_regex.hpp(243)
: while compiling class-template member function 'bool
boost::re_detail::perl_matcher<BidiIterator,Allocator,traits,Allocator2>::find_imp(void)'
with
[
BidiIterator=PData::iterator,
Allocator=allocator_type,
traits=boost::regex_traits<char>,
Allocator2=std::allocator<char>
]
c:\Program Files\Microsoft
Visual Studio .NET 2003\Vc7\include\xlocmon(190) : while compiling
class-template member function
'boost::re_detail::perl_matcher<BidiIterator,Allocator,traits,Allocator2>::perl_matcher(BidiIterator,BidiIterator,boost::match_results<BidiIterator,Allocator>
&,const boost::reg_expression<charT>
&,boost::regex_constants::match_flag_type)'
with
[
BidiIterator=PData::iterator,
Allocator=allocator_type,
traits=boost::regex_traits<char>,
Allocator2=std::allocator<char>,
charT=char
]
z:\n2_3rd_party_components\boost\delivery\include\boost\regex\v4\regex_search.hpp(38)
: see reference to class template instantiation
'boost::re_detail::perl_matcher<BidiIterator,Allocator,traits,Allocator2>'
being compiled
with
[
BidiIterator=PData::iterator,
Allocator=allocator_type,
traits=boost::regex_traits<char>,
Allocator2=std::allocator<char>
]
z:\med2\dev\ParserLib\parser.cpp(4790) : see reference to function template
instantiation 'bool
boost::regex_search<PData::iterator,allocator_type,char,boost::regex_traits<charT>,std::allocator<_Ty>>(BidiIterator,BidiIterator,boost::match_results<BidiIterator,Allocator>
&,const boost::reg_expression<charT>
&,boost::regex_constants::match_flag_type)' being
compiled
with
[
charT=char,
_Ty=char,
BidiIterator=PData::iterator,
Allocator=allocator_type
]
"z:\med2\dev\ParserLib\parser.cpp(4790)" is marked
above with red.
"z:\n2_3rd_party_components\boost\delivery\include\boost\regex\v4\regex_search.hpp(38)"
is listed below:
template
<class BidiIterator, class Allocator, class charT, class traits, class
Allocator2>
bool regex_search(BidiIterator first, BidiIterator last,
match_results<BidiIterator, Allocator>& m,
const reg_expression<charT, traits, Allocator2>& e,
match_flag_type flags = match_default)
{
if(e.flags() &
regex_constants::failbit)
return
false;
re_detail::perl_matcher<BidiIterator, Allocator,
traits, Allocator2> matcher(first, last, m, e,
flags); <-- line 38
return
matcher.find();
}
"z:\n2_3rd_party_components\boost\delivery\include\boost\regex\v4\perl_matcher_common.hpp(208)"
is part of the following function:
template <class
BidiIterator, class Allocator, class traits, class Allocator2>
bool
perl_matcher<BidiIterator, Allocator, traits,
Allocator2>::find_imp()
and the line (208) is listed
below:
// start again:
search_base = position =
m_result[0].second;
<-- line 208
// If last match
was null and match_not_null was not set then
increment
// our start position, otherwise we
go into an infinite loop:
Searching Google for this
problem did not help very much, so I was wondering if you have encounter it and
put more light on it and the solution?
2.
Problems on HP: