Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2004-08-28 04:40:50

Daryle Walker wrote:

>>Currently, the name mangling scheme used on this platform is the default
>>one selected by the compiler. It turns out that this is a bad choice when
>>compiling boost. The problem is illustrated by the following example:
>>#include <iostream>
>>using namespace std;
>>template <typename T> void foo(T const &x)
>> cout << "1" << endl;
>>template <typename T> void foo(T * const &x)
>> cout << "2" << endl;
>>int main()
>> foo("abc");
>> return 0;
>>This prints out "2" with the default name mangling scheme. When manually
>>selecting "ansi" as the name mangling scheme, the correct result "1" is
> Why is [1] the correct answer? The string has type "char const [4]". I
> thought that the array-to-pointer conversion will happen, turning the string
> to a "char const *", which will match [2] with "char" for "T". I'm guessing
> that you think the reference in [1] prevents the array-to-pointer
> conversion, so [1] is the better match with "char [4]" for "T".
> I am guessing your logic correctly? Does anyone know if [1] is supposed to
> be the right answer? (No need to petition to change to compiler settings to
> choose [1] if [2] is supposed to be the standard answer.)

Have a look at the answer from Jonathan Wakely in the thread "algorithm
/ string / container regression failure on tru64cxx65". That should
cover your question, I think.


Boost list run by bdawes at, gregod at, cpdaniel at, john at