This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc-3.1 boost-1.28.0 problem
- From: nbecker at hns dot com (Neal D. Becker)
- To: gcc at gcc dot gnu dot org
- Date: 16 May 2002 13:34:07 -0400
- Subject: gcc-3.1 boost-1.28.0 problem
A new error appears with boost-1.28.0 + gcc-3.1 that did not appear
with gcc-3.0.4. I don't know if this code is actually valid or not.
It looks like this:
template<class UniformRandomNumberGenerator, int k,
class IntType = typename UniformRandomNumberGenerator::result_type,
...
class shuffle_output
{
public:
typedef UniformRandomNumberGenerator base_type;
typedef typename base_type::result_type result_type;
...
friend std::ostream& operator<<(std::ostream& os, const shuffle_output& s)
{
os << s._rng << " " << s.y << " ";
>>> std::copy(s.v, s.v+k, std::ostream_iterator<result_type>(os, " "));
return os;
}
The problem is this:
/usr/local/src/boost/boost/random/mersenne_twister.hpp: In function
`std::ostream& boost::random::operator<<(std::ostream&, const
boost::random::mersenne_twister<DataType, n, m, r, a, u, s, b, t, c, l,
val>&)':
/usr/local/src/boost/boost/random/shuffle_output.hpp:85: parse error before `;'
token
This is the line marked with ">>>" above. I'm guessing that gcc
doesn't like result_type, because the friend function has no access to
the typedef. Is this code OK or not?