which compiler are you using while using bgl?
I am a newbie from China, I am sorry about my poor English. I encountered a
problem while using bgl.
I need your help. and I'd like to know what compiler you are using while
using bgl.
My Environment: Windows2000 + devc++4.9.6.0(it uses g++ as it's compiler)
But it can't compile and run the following example:
_________Example start____________
#include <deque> // to store the vertex ordering
#include <vector>
#include <list>
#include <iostream>
#include
Hi Jun,
Most of the BGL does not require partial specialization. vector_as_graph.hpp
is an exception. I recommend that you not use vector_as_graph and use
adjacency_list or something else instead.
Cheers,
Jeremy
--On Monday, November 18, 2002 3:17 PM +0800 Jun Zhang
I am a newbie from China, I am sorry about my poor English. I encountered a problem while using bgl. I need your help. and I'd like to know what compiler you are using while using bgl.
My Environment: Windows2000 + devc++4.9.6.0(it uses g++ as it's compiler) But it can't compile and run the following example: _________Example start____________
# include <deque> // to store the vertex ordering # include <vector> # include <list> # include <iostream>
# include
Hi, alls Just wondering if there is some issue to the following problem (a and b instance are not in the same block code in true life of course) : class A; class B : public A ... void main() { shared_ptr<A> a; shared_ptr<B> b(new B); a = b; // what i would like, but it wont compile: no copy ctor available } I can try to do something like: void main() { shared_ptr<A> a; shared_ptr<B> b(new B); a.reset(b.get()); // bad design, reference counter corruped } I do not want to do something like the following, because each time i will need of b, i will be obliged to cast again to B type. main() { shared_ptr<A> a; shared_ptr<A> b(dynamic_cast(new B)); a = b; } Any solutions ? --------------------------------- Yahoo! Mail -- Une adresse @yahoo.fr gratuite et en français ! [Non-text portions of this message have been removed]
On Monday, November 18, 2002, at 09:41 AM, Alexandre Carsac wrote:
Just wondering if there is some issue to the following problem (a and b instance are not in the same block code in true life of course) : class A; class B : public A ...
void main() { shared_ptr<A> a; shared_ptr<B> b(new B); a = b; // what i would like, but it wont compile: no copy ctor available }
The above is an upcast, not a downcast. It should compile. If not, we have some sort of shared_ptr bug. But you can't compile a class B that inherits from A without the definition for class A; we need a real example here, because there are errors in the shorthand one you provided. If you are really talking about polymorphic smart pointer downcasts, even though your example here shows an upcast, then you probably want shared_polymorphic_downcast or shared_static_cast. Those are documented at http://boost.org/libs/smart_ptr/shared_ptr.htm. -- Darin
Yes, you are right. Thanks for your quick response. I made a quick test, and it compiles.
I was cheated by the compiler response, the fact i do not use to play with polymorphic's shared_ptr. the instance "a" was not a shared_ptr in my code :
void main()
{
scoped_ptr<A> a;
shared_ptr<B> b(new B);
a = b; // no copy ctor available.
}
After correction (replacement of scoped_ptr with shared_ptr), it works fine.
Thanks a lot Darin.
Darin Adler
Just wondering if there is some issue to the following problem (a and b instance are not in the same block code in true life of course) : class A; class B : public A ...
void main() { shared_ptr<A> a; shared_ptr<B> b(new B); a = b; // what i would like, but it wont compile: no copy ctor available }
The above is an upcast, not a downcast. It should compile. If not, we have some sort of shared_ptr bug. But you can't compile a class B that inherits from A without the definition for class A; we need a real example here, because there are errors in the shorthand one you provided. If you are really talking about polymorphic smart pointer downcasts, even though your example here shows an upcast, then you probably want shared_polymorphic_downcast or shared_static_cast. Those are documented at http://boost.org/libs/smart_ptr/shared_ptr.htm. -- Darin --------------------------------- Yahoo! Mail -- Une adresse @yahoo.fr gratuite et en français ! [Non-text portions of this message have been removed]
Thanks for your help.That is to say, VC6 can compile most of the BGL
programs.
"Jeremy Siek"
Hi Jun,
Most of the BGL does not require partial specialization. vector_as_graph.hpp is an exception. I recommend that you not use vector_as_graph and use adjacency_list or something else instead.
Cheers, Jeremy
--On Monday, November 18, 2002 3:17 PM +0800 Jun Zhang
wrote: I am a newbie from China, I am sorry about my poor English. I encountered a problem while using bgl. I need your help. and I'd like to know what compiler you are using while using bgl.
My Environment: Windows2000 + devc++4.9.6.0(it uses g++ as it's compiler) But it can't compile and run the following example: _________Example start____________
# include <deque> // to store the vertex ordering # include <vector> # include <list> # include <iostream>
# include
Info: http://www.boost.org Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
participants (4)
-
Alexandre Carsac
-
Darin Adler
-
Jeremy Siek
-
Jun Zhang