|
Boost : |
From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2004-08-23 03:30:54
Hello,
currently beforementioned test fails on tru64cxx65 with the following error
message:
cxx: Error: ../libs/algorithm/string/test/container_test.cpp, line 94: #434 a
reference of type "char *&" (not const-qualified) cannot be
initialized with a value of type "char [4]"
argument_test( ach1, "abc" );
The underlying problem is illustrated by the following code snippet:
---%<---
template< typename T >
void argument_cv_test( const T& C, const string& strResult )
{
}
template< typename T >
void argument_test( T& C, const string& strResult )
{
}
void foo()
{
char ach1[]="abc";
argument_cv_test( ach1, "abc" ); // ok
argument_test( ach1, "abc" ); // not ok
}
--->%---
The line marked as not ok triggers the error. I tried to compile that code
snippet with Comeau online and it succeeds. But I could not find a
definitive answer in the C++ standard whether that code is legal or not.
If it's legal, could anyone please provide me with a reference to the
paragraph of the standard which applies here? I would need that to file a
proper bug report to HP.
TIA, Markus
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk