|
Boost : |
From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2001-02-04 13:21:15
Doug Gregor wrote:
> The code is available at:
> http://groups.yahoo.com/group/boost/files/lambda/Win32%20Port/tuple.hpp
Are there some tests available somewhere?
Anyway, I put it through Comeau C++ in strict mode, here are a
few results:
Comeau C/C++ 4.2.44 (Aug 2 2000 16:10:16) for RedHat_LINUX_INTEL_ELF_BETA3
Copyright 1988-2000 Comeau Computing. All rights reserved.
MODE:strict warnings C++
"tuple.hpp", line 223: warning: extra ";" ignored
};
^
"tuple.hpp", line 231: warning: extra ";" ignored
};
^
"tuple.hpp", line 295: warning: extra ";" ignored
};
^
"tuple.hpp", line 304: warning: extra ";" ignored
};
^
"tuple.hpp", line 313: warning: extra ";" ignored
};
^
"tuple.hpp", line 322: warning: extra ";" ignored
};
^
There is no empty declaration (only empty statements), thus the semicolon
is not allowed in these places. In "strict" mode, not "strict warnings"
mode as shown above, these come out as errors.
"tuple.hpp", line 266: error: identifier "head" is undefined
head = other.head;
^
"tuple.hpp", line 267: error: identifier "tail" is undefined
tail = other.tail;
^
This refers to members of a dependent base class, thus this needs to
be (syntactially) dependent as well, e.g. "this->head" / "this->tail".
"tuple.hpp", line 380: error: no operator "<<" matches these operands
operand types are: _STL::ostream << const char [3]
os << ", " << c.head;
^
"tuple.hpp", line 385: error: no operator "<<" matches these operands
operand types are: _STL::ostream << const char [2]
os << ")";
^
<iosfwd> only is insufficient, because "os" is not a dependent name,
thus is bound during template definition. Therefore, the whole of
<ostream> must be visible to find the proper operator<<.
Jens Maurer
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk