Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > std::vector<boost::xpressive::sregex> fails to compile using gcc

Reply
Thread Tools

std::vector<boost::xpressive::sregex> fails to compile using gcc

 
 
flewpaul@gmail.com
Guest
Posts: n/a
 
      01-21-2010
Hi

I'm trying to use a vector of Boost Xpressive sregex objects. VS2005
compiles my code successfully, but gcc 3.4 and 4.1 fail with:

<path>/include/c++/3.4.5/bits/stl_construct.h: In function `void
std::__destroy_aux(_ForwardIterator, _ForwardIterator, __false_type)
[with _ForwardIterator = boost:pressive::sregex*]':
<path>/include/c++/3.4.5/bits/stl_construct.h:152: instantiated from
`void std::_Destroy(_ForwardIterator, _ForwardIterator) [with
_ForwardIterator = boost:pressive::sregex*]'
<path>/include/c++/3.4.5/bits/stl_vector.h:256: instantiated from
`std::vector<_Tp, _Alloc>::~vector() [with _Tp =
boost:pressive::sregex, _Alloc =
std::allocator<boost:pressive::sregex>]'
...\test.cpp:9: instantiated from here
<path>/include/c++/3.4.5/bits/stl_construct.h:120: error: no matching
function for call to `_Destroy(const
boost:roto::exprns_::expr<boost:roto::tag::add ress_of,
boost:roto::argsns_::list1<boost:pressive::bas ic_regex<__gnu_cxx::__normal_iterator<const
char*, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > >&>, 1l>)'

The code to generate this is:

#include <vector>
#include <boost/xpressive/xpressive_dynamic.hpp>

using namespace std;
using namespace boost:pressive;

int main(int argc, char* argv[])
{
vector<sregex> vec;
return 0;
}

Appreciate any feedback on solving this problem.

Rgds


Paul Flew
 
Reply With Quote
 
 
 
 
Rene Gill
Guest
Posts: n/a
 
      01-22-2010
Should it not be g++ the compiler?


 
Reply With Quote
 
 
 
 
**Group User**
Guest
Posts: n/a
 
      01-22-2010
On Jan 22, 10:00*am, Rene Gill <(E-Mail Removed)> wrote:
> Should it not be g++ the compiler?


Mr Gill, I don't think so
 
Reply With Quote
 
Christophe Bourez
Guest
Posts: n/a
 
      01-22-2010
I confirm the issue. By replacing the vector by a list, the example
compiles fine. I suggest you to ask your question directly on the
boost-users mailing list.

A priori, it seems to be a compiler bug.

Christophe


 
Reply With Quote
 
Jeff Flinn
Guest
Posts: n/a
 
      01-22-2010
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Hi
>
> I'm trying to use a vector of Boost Xpressive sregex objects. VS2005
> compiles my code successfully, but gcc 3.4 and 4.1 fail with:
>
> <path>/include/c++/3.4.5/bits/stl_construct.h: In function `void
> std::__destroy_aux(_ForwardIterator, _ForwardIterator, __false_type)
> [with _ForwardIterator = boost:pressive::sregex*]':
> <path>/include/c++/3.4.5/bits/stl_construct.h:152: instantiated from
> `void std::_Destroy(_ForwardIterator, _ForwardIterator) [with
> _ForwardIterator = boost:pressive::sregex*]'
> <path>/include/c++/3.4.5/bits/stl_vector.h:256: instantiated from
> `std::vector<_Tp, _Alloc>::~vector() [with _Tp =
> boost:pressive::sregex, _Alloc =
> std::allocator<boost:pressive::sregex>]'
> ..\test.cpp:9: instantiated from here
> <path>/include/c++/3.4.5/bits/stl_construct.h:120: error: no matching
> function for call to `_Destroy(const
> boost:roto::exprns_::expr<boost:roto::tag::add ress_of,
> boost:roto::argsns_::list1<boost:pressive::bas ic_regex<__gnu_cxx::__normal_iterator<const
> char*, std::basic_string<char, std::char_traits<char>,
> std::allocator<char> > > >&>, 1l>)'
>
> The code to generate this is:
>
> #include <vector>
> #include <boost/xpressive/xpressive_dynamic.hpp>
>
> using namespace std;
> using namespace boost:pressive;
>
> int main(int argc, char* argv[])
> {
> vector<sregex> vec;
> return 0;
> }


My guess is that sregex is an incomplete type in this context, and IIRC,
std::vector requires complete type for instantiation. Did you mean to
include xpressive_dynamic.hpp? sregex probably is only forward declared
with this include. Did you mean to include xpressive_static.hpp?

Jeff
 
Reply With Quote
 
Christophe Bourez
Guest
Posts: n/a
 
      01-22-2010
On 22 jan, 14:38, Jeff Flinn <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > Hi

>
> > I'm trying to use a vector of Boost Xpressive sregex objects. VS2005
> > compiles my code successfully, but gcc 3.4 and 4.1 fail with:

>
> > <path>/include/c++/3.4.5/bits/stl_construct.h: In function `void
> > std::__destroy_aux(_ForwardIterator, _ForwardIterator, __false_type)
> > [with _ForwardIterator = boost:pressive::sregex*]':
> > <path>/include/c++/3.4.5/bits/stl_construct.h:152: * instantiated from
> > `void std::_Destroy(_ForwardIterator, _ForwardIterator) [with
> > _ForwardIterator = boost:pressive::sregex*]'
> > <path>/include/c++/3.4.5/bits/stl_vector.h:256: * instantiated from
> > `std::vector<_Tp, _Alloc>::~vector() [with _Tp =
> > boost:pressive::sregex, _Alloc =
> > std::allocator<boost:pressive::sregex>]'
> > ..\test.cpp:9: * instantiated from here
> > <path>/include/c++/3.4.5/bits/stl_construct.h:120: error: no matching
> > function for call to `_Destroy(const
> > boost:roto::exprns_::expr<boost:roto::tag::add ress_of,
> > boost:roto::argsns_::list1<boost:pressive::bas ic_regex<__gnu_cxx::__normal_iterator<const
> > char*, std::basic_string<char, std::char_traits<char>,
> > std::allocator<char> > > >&>, 1l>)'

>
> > The code to generate this is:

>
> > #include <vector>
> > #include <boost/xpressive/xpressive_dynamic.hpp>

>
> > using namespace std;
> > using namespace boost:pressive;

>
> > int main(int argc, char* argv[])
> > {
> > * * * *vector<sregex> vec;
> > * * * *return 0;
> > }

>
> My guess is that sregex is an incomplete type in this context, and IIRC,
> std::vector requires complete type for instantiation. Did you mean to
> include xpressive_dynamic.hpp? sregex probably is only forward declared
> with this include. Did you mean to include xpressive_static.hpp?
>
> Jeff


Hi Jeff,

In my test, I did
#include <boost/xpressive/xpressive.hpp> which includes both dynamic
and static.

Christophe
 
Reply With Quote
 
flewpaul@gmail.com
Guest
Posts: n/a
 
      01-22-2010
On Jan 22, 5:41*am, Christophe Bourez <(E-Mail Removed)> wrote:
> On 22 jan, 14:38, Jeff Flinn <(E-Mail Removed)> wrote:
>
>
>
> > (E-Mail Removed) wrote:
> > > Hi

>
> > > I'm trying to use a vector of Boost Xpressive sregex objects. VS2005
> > > compiles my code successfully, but gcc 3.4 and 4.1 fail with:

>
> > > <path>/include/c++/3.4.5/bits/stl_construct.h: In function `void
> > > std::__destroy_aux(_ForwardIterator, _ForwardIterator, __false_type)
> > > [with _ForwardIterator = boost:pressive::sregex*]':
> > > <path>/include/c++/3.4.5/bits/stl_construct.h:152: * instantiated from
> > > `void std::_Destroy(_ForwardIterator, _ForwardIterator) [with
> > > _ForwardIterator = boost:pressive::sregex*]'
> > > <path>/include/c++/3.4.5/bits/stl_vector.h:256: * instantiated from
> > > `std::vector<_Tp, _Alloc>::~vector() [with _Tp =
> > > boost:pressive::sregex, _Alloc =
> > > std::allocator<boost:pressive::sregex>]'
> > > ..\test.cpp:9: * instantiated from here
> > > <path>/include/c++/3.4.5/bits/stl_construct.h:120: error: no matching
> > > function for call to `_Destroy(const
> > > boost:roto::exprns_::expr<boost:roto::tag::add ress_of,
> > > boost:roto::argsns_::list1<boost:pressive::bas ic_regex<__gnu_cxx::__normal_iterator<const
> > > char*, std::basic_string<char, std::char_traits<char>,
> > > std::allocator<char> > > >&>, 1l>)'

>
> > > The code to generate this is:

>
> > > #include <vector>
> > > #include <boost/xpressive/xpressive_dynamic.hpp>

>
> > > using namespace std;
> > > using namespace boost:pressive;

>
> > > int main(int argc, char* argv[])
> > > {
> > > * * * *vector<sregex> vec;
> > > * * * *return 0;
> > > }

>
> > My guess is that sregex is an incomplete type in this context, and IIRC,
> > std::vector requires complete type for instantiation. Did you mean to
> > include xpressive_dynamic.hpp? sregex probably is only forward declared
> > with this include. Did you mean to include xpressive_static.hpp?

>
> > Jeff

>
> Hi Jeff,
>
> In my test, I did
> #include <boost/xpressive/xpressive.hpp> which includes both dynamic
> and static.
>
> Christophe


Thanks for the responses. I'll look at my code to see whether a list<>
will offer the performance I need in this case. I did cross-post to
gnu.g++.bug but haven't got any response - I'll post on the Boost list
aswell.

Many Thanks



Paul
 
Reply With Quote
 
flewpaul@gmail.com
Guest
Posts: n/a
 
      01-25-2010
On Jan 22, 9:19*am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
> On Jan 22, 5:41*am, Christophe Bourez <(E-Mail Removed)> wrote:
>
>
>
> > On 22 jan, 14:38, Jeff Flinn <(E-Mail Removed)> wrote:

>
> > > (E-Mail Removed) wrote:
> > > > Hi

>
> > > > I'm trying to use a vector of Boost Xpressive sregex objects. VS2005
> > > > compiles my code successfully, but gcc 3.4 and 4.1 fail with:

>
> > > > <path>/include/c++/3.4.5/bits/stl_construct.h: In function `void
> > > > std::__destroy_aux(_ForwardIterator, _ForwardIterator, __false_type)
> > > > [with _ForwardIterator = boost:pressive::sregex*]':
> > > > <path>/include/c++/3.4.5/bits/stl_construct.h:152: * instantiated from
> > > > `void std::_Destroy(_ForwardIterator, _ForwardIterator) [with
> > > > _ForwardIterator = boost:pressive::sregex*]'
> > > > <path>/include/c++/3.4.5/bits/stl_vector.h:256: * instantiated from
> > > > `std::vector<_Tp, _Alloc>::~vector() [with _Tp =
> > > > boost:pressive::sregex, _Alloc =
> > > > std::allocator<boost:pressive::sregex>]'
> > > > ..\test.cpp:9: * instantiated from here
> > > > <path>/include/c++/3.4.5/bits/stl_construct.h:120: error: no matching
> > > > function for call to `_Destroy(const
> > > > boost:roto::exprns_::expr<boost:roto::tag::add ress_of,
> > > > boost:roto::argsns_::list1<boost:pressive::bas ic_regex<__gnu_cxx::__normal_iterator<const
> > > > char*, std::basic_string<char, std::char_traits<char>,
> > > > std::allocator<char> > > >&>, 1l>)'

>
> > > > The code to generate this is:

>
> > > > #include <vector>
> > > > #include <boost/xpressive/xpressive_dynamic.hpp>

>
> > > > using namespace std;
> > > > using namespace boost:pressive;

>
> > > > int main(int argc, char* argv[])
> > > > {
> > > > * * * *vector<sregex> vec;
> > > > * * * *return 0;
> > > > }

>
> > > My guess is that sregex is an incomplete type in this context, and IIRC,
> > > std::vector requires complete type for instantiation. Did you mean to
> > > include xpressive_dynamic.hpp? sregex probably is only forward declared
> > > with this include. Did you mean to include xpressive_static.hpp?

>
> > > Jeff

>
> > Hi Jeff,

>
> > In my test, I did
> > #include <boost/xpressive/xpressive.hpp> which includes both dynamic
> > and static.

>
> > Christophe

>
> Thanks for the responses. I'll look at my code to see whether a list<>
> will offer the performance I need in this case. I did cross-post to
> gnu.g++.bug but haven't got any response - I'll post on the Boost list
> aswell.
>
> Many Thanks
>
> Paul


Posted on Boost bug list, turns out it has already been reported and
fixed for Boost 1.42 (https://svn.boost.org/trac/boost/ticket/3712)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to compile Python 2.6.4 on AIX using gcc chuck Python 2 11-04-2009 05:27 PM
How to compile the following source code in VC6// I have error inVC++6 but compile ok in GCC fAnSKyer C++ 2 06-07-2009 07:57 AM
cant compile on linux system.cant compile on cant compile onlinux system. Nagaraj C++ 1 03-01-2007 11:18 AM
Template construction in old gcc 3.3.3 does not compile in gcc 3.4.4 eknecronzontas@yahoo.com C++ 5 09-17-2005 12:27 AM
gcc 2.95 and gcc 3.2 gouqizi.lvcha@gmail.com C++ 8 03-16-2005 02:34 AM



Advertisments