Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-01-02 11:04:37


Looking at the current CVS, Problem 2 has been fixed. I'll take a
look at problem 1 tonight.

Cheers,
Jeremy

On Tue, 2 Jan 2001, Andrew Myers wrote:

andrew> To start with, I realise the IRIX compilers are not among the supported
andrew> compilers, but this might be useful for future support.
andrew>
andrew> The platform on interest is IRIX 6.5, running version 7.30 of the MIPSPro
andrew> compilers. I am using boost 1.19.0.
andrew>
andrew> I have two problems that have appeared.
andrew>
andrew> Problem 1
andrew> ---------
andrew>
andrew> The following is a stripped down piece of code that fails to compile on IRIX,
andrew> but compiles successfully on MSVC++ 6, (which is my other platform of interest)
andrew>
andrew> Similar code appears in boost/graph/breadth_first_search.hpp, where the
andrew> make_bfs_visitor function, returns a bfs_visitor object, whose constructor has a
andrew> default null_visitor() argument. This means libs/graph/example/bfs_basics.C does
andrew> not compile.
andrew>
andrew>
andrew> struct Null
andrew> {
andrew> };
andrew>
andrew> template <class T>
andrew> class Foo
andrew> {
andrew> public:
andrew> Foo( T t = Null() ) {}
andrew> };
andrew>
andrew> template <class T>
andrew> Foo<T>
andrew> MakeFoo( T t )
andrew> {
andrew> return Foo<T>(t);
andrew> };
andrew>
andrew> main()
andrew> {
andrew> // Bad on IRIX
andrew> int i = 1;
andrew> MakeFoo<int>( i );
andrew>
andrew> // OK on IRIX;
andrew> // Null i;
andrew> // MakeFoo<Null>(i);
andrew>
andrew> return 0;
andrew> }
andrew>
andrew>
andrew> The resulting error message is,
andrew>
andrew> cc-1387 CC: ERROR File = temp.C, Line = 9
andrew> No suitable conversion function from "Null" to "int" exists.
andrew>
andrew> Foo( T t = Null() ) {}
andrew> ^
andrew> detected during instantiation of class "Foo<int>" at line 23
andrew>
andrew> 1 error detected in the compilation of "temp.C".
andrew>
andrew>
andrew>
andrew> It would appear the compiler is attempting to build the Foo constructor,
andrew> assigning the default argument when it is not necessary, since an argument is
andrew> being passed.
andrew>
andrew> My suggested workaround for this would be to replace the current constructor
andrew> with two constructors
andrew>
andrew> class Foo
andrew> {
andrew> public:
andrew> Foo() {}; // Initialise member data with Null
andrew> Foo( T t ) {};
andrew> };
andrew>
andrew>
andrew>
andrew> Problem 2
andrew> ---------
andrew>
andrew> In boost/graph/detail/adjancency_list.hpp (around line 2108) I have had to
andrew> change
andrew>
andrew> typedef typename boost::iterator_adaptor<InEdgeIter,
andrew> in_edge_iter_policies<vertex_descriptor>,
andrew> edge_iter_traits<edge_descriptor, InEdgeIterTraits>
andrew> > in_edge_iterator;
andrew> to
andrew> typedef struct boost::iterator_adaptor<InEdgeIter,
andrew> in_edge_iter_policies<vertex_descriptor>,
andrew> edge_iter_traits<edge_descriptor, InEdgeIterTraits>
andrew> > in_edge_iterator;
andrew>
andrew> I.e. typedef typename to typdef struct.
andrew>
andrew> Similar around line 2125.
andrew>
andrew> I don't really understand what the problem is, but the change allowed the code
andrew> to compile.
andrew>
andrew>
andrew>
andrew>
andrew> Anyway, I am interested in people's thoughts on these. Is anyone working with
andrew> boost on IRIX and is there a plan for future boost releases to provide support
andrew> for IRIX.
andrew>
andrew>
andrew> Thanks.
andrew>
andrew>
andrew> --
andrew> Andrew Myers I-SiTE
andrew> Senior Software Engineer 3D Laser Imaging
andrew> Phone: (+61 8) 8338 9222
andrew> Fax : (+61 8) 8338 9229
andrew> Email: andrew_at_[hidden] http://www.isite3d.com.au
andrew>
andrew>
andrew>
andrew>

----------------------------------------------------------------------
 Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
 Ph.D. Candidate email: jsiek_at_[hidden]
 Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk