ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] regex problem
by Pavol Droba other posts by this author
Sep 19 2003 8:22AM messages near this date
Re: [boost] date_time linker problems/errors | Re: [boost] regex problem
Hi,

I have a problem when using regex v4 from cvs. I'm porting my code from v3 to v4 version,
and I have encountered a problem when using regex_search. 

One of the test cases I need to compile is trying to do something like this:

   vector<int>  vec;
   regex rx("whatever");
   match_results m;

   regex_search( vec.begin(), vec.end(), m, rx, match_default );


My code is somewhat more complicated, but it is only forward to this call.
The problem occurs only when trying to search in the container with a different char_type th
en the one 
in the regex. In version v3 it worked fine, I have only changed match_flags type from unsign
ed int to match_flag_type.
Has something changed since then?

I'm using vc7.0 and I got following error dump ( it is little bit longer ):

d:\Boost\boost\regex\v4\regex_search.hpp(42) : error C2664: 'boost::re_detail::perl_matcher<
BidiIterator,Allocator,traits,Allocator2> ::perl_matcher(BidiIterator,boost::string_algo::con
tainer_traits<T> ::result_iterator,boost::match_results<RandomAccessIterator,Allocator> &,con
st boost::reg_expression<charT,traits,Allocator2>  &,boost::regex_constants::match_flag_type)
' : cannot convert parameter 4 from 'const boost::reg_expression<charT,traits,Allocator> ' to
 'const boost::reg_expression<charT,traits,Allocator>  &'
        with
        [
            BidiIterator=boost::string_algo::container_traits<std::vector<int,std::allocator
<int> >>::result_iterator,
            Allocator=boost::detail::allocator_adapter<boost::sub_match<boost::string_algo::
detail::regex_search_result<boost::string_algo::container_traits<std::vector<int,std::alloca
tor<int> >>::result_iterator>::iterator>,boost::detail::simple_alloc>,
            traits=boost::regex_traits<char> ,
            Allocator2=boost::detail::allocator_adapter<char,boost::detail::simple_alloc> ,
            T=std::vector<int,std::allocator<int> >,
            RandomAccessIterator=boost::string_algo::detail::regex_search_result<boost::stri
ng_algo::container_traits<std::vector<int,std::allocator<int> >>::result_iterator>::iterator,
            charT=boost::re_detail::perl_matcher<boost::string_algo::container_traits<std::v
ector<int,std::allocator<int> >>::result_iterator,boost::detail::allocator_adapter<boost::sub
_match<boost::string_algo::detail::regex_search_result<boost::string_algo::container_traits<
std::vector<int,std::allocator<int> >>::result_iterator>::iterator>,boost::detail::simple_all
oc> ,boost::regex_traits<char>,boost::detail::allocator_adapter<char,boost::detail::simple_al
loc> >::char_type
        ]
        and
        [
            charT=char,
            traits=boost::regex_traits<char> ,
            Allocator=boost::detail::allocator_adapter<char,boost::detail::simple_alloc> 
        ]
        and
        [
            charT=boost::re_detail::perl_matcher<boost::string
_algo::container_traits<std::vector<int,std::allocator<int> >>::result_iterator,boost::detail
::allocator_adapter<boost::sub_match<boost::string_algo::detail::regex_search_result<boost::
string_algo::container_traits<std::vector<int,std::allocator<int> >>::result_iterator>::itera
tor> ,boost::detail::simple_alloc>,boost::regex_traits<char>,boost::detail::allocator_adapter
<char,boost::detail::simple_alloc> >::char_type,
            traits=boost::regex_traits<char> ,
            Allocator=boost::detail::allocator_adapter<char,boost::detail::simple_alloc> 
        ]
        Reason: cannot convert from 'const boost::reg_expression<charT,traits,Allocator> ' to
 'const boost::reg_expression<charT,traits,Allocator> '
        with
        [
            charT=char,
            traits=boost::regex_traits<char> ,
            Allocator=boost::detail::allocator_adapter<char,boost::detail::simple_alloc> 
        ]
        and
        [
            charT=boost::re_detail::perl_matcher<boost::string_algo::container_traits<std::v
ector<int,std::allocator<int> >>::result_iterator,boost::detail::allocator_adapter<boost::sub
_match<boost::string_algo::detail::regex_search_result<boost::string_algo::container_traits<
std::vector<int,std::allocator<int> >>::result_iterator>::iterator>,boost::detail::simple_all
oc> ,boost::regex_traits<char>,boost::detail::allocator_adapter<char,boost::detail::simple_al
loc> >::char_type,
            traits=boost::regex_traits<char> ,
            Allocator=boost::detail::allocator_adapter<char,boost::detail::simple_alloc> 
        ]
        No constructor could take the source type, or constructor overload resolution was am
biguous
        d:\Projects\Boost\string_algo\boost\string_algo\detail\find_regex.hpp(99) : see refe
rence to function template instantiation 'bool boost::regex_search(BidiIterator,boost::strin
g_algo::container_traits<T> ::result_iterator,boost::match_results<RandomAccessIterator,Alloc
ator>  &,const boost::reg_expression<charT,traits,boost::detail::allocator_adapter<char,Base>
>  &,boost::regex_constants::match_flag_type)' being compiled
        with
        [
            BidiIterator=boost::string_algo::container_traits<std::vector<int,std::allocator
<int> >>::result_iterator,
            T=std::vector<int,std::allocator<int> >,
            RandomAccessIterator=boost::string_algo::detail::regex_search_result<boost::stri
ng_algo::container_traits<std::vector<int,std::allocator<int> >>::result_iterator>::iterator,
            Allocator=boost::detail::allocator_adapter<boost::sub_match<boost::string_algo::
detail::regex_search_result<boost::string_algo::container_traits<
std::vector<int,std::allocator<int> >>::result_iterator>::iterator>,boost::detail::simple_all
oc> ,
            charT=char,
            traits=boost::regex_traits<char> ,
            Base=boost::detail::simple_alloc
        ]
        d:\Projects\Boost\string_algo\boost\string_algo\detail\find_regex.hpp(116) : see ref
erence to function template instantiation 'boost::string_algo::detail::regex_search_result<I
teratorT>  boost::string_algo::detail::find_regexF<RegExT>::operator ()(ForwardIteratorT,boos
t::string_algo::container_traits<T> ::result_iterator) const' being compiled
        with
        [
            IteratorT=boost::string_algo::container_traits<std::vector<int,std::allocator<in
t> >>::result_iterator,
            RegExT=boost::reg_expression<char,boost::regex_traits<char> ,boost::detail::alloc
ator_adapter<char,boost::detail::simple_alloc> >,
            ForwardIteratorT=boost::string_algo::container_traits<std::vector<int,std::alloc
ator<int> >>::result_iterator,
            T=std::vector<int,std::allocator<int> >
        ]
        d:\Projects\Boost\string_algo\boost\string_algo\regex.hpp(51) : see reference to fun
ction template instantiation 'boost::string_algo::detail::regex_search_result<IteratorT>  boo
st::string_algo::detail::find_regexF<RegExT> ::operator ()(InputT &) const' being compiled
        with
        [
            IteratorT=boost::string_algo::container_traits<std::vector<int,std::allocator<in
t> >>::result_iterator,
            RegExT=boost::reg_expression<char,boost::regex_traits<char> ,boost::detail::alloc
ator_adapter<char,boost::detail::simple_alloc> >,
            InputT=std::vector<int,std::allocator<int> >
        ]
        d:\Projects\Boost\string_algo\libs\string_algo\test\regex_test.cpp(55) : see referen
ce to function template instantiation 'boost::iterator_range<IteratorT>  boost::find_regex(In
putT &,const boost::reg_expression<charT,traits,Allocator>  &,boost::regex_constants::match_f
lag_type)' being compiled
        with
        [
            IteratorT=std::vector<int,std::allocator<int> >::iterator
,
            InputT=std::vector<int,std::allocator<int> >,
            charT=char,
            traits=boost::regex_traits<char> ,
            Allocator=boost::detail::allocator_adapter<char,boost::detail::simple_alloc> 
        ]


Thanks,

Pavol
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Pavol Droba
John Maddock
Pavol Droba
John Maddock
Pavol Droba

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved