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