Boost logo

Boost :

From: David Bergman (davidb_at_[hidden])
Date: 2002-09-09 20:55:53


So what input is provided to the MSVC name mangling if not the template
arguments? Not much of a mangling, since there is then not many items to
mangle into one name...

A bit odd, I find it hard to believe it is that simple.


-----Original Message-----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of Thomas Witt
Sent: Sunday, September 08, 2002 12:32 PM
To: boost_at_[hidden]
Subject: Re: [boost] Interval Library review


On Sunday 08 September 2002 01:35, Gennadiy Rozental wrote:
> 9. Function templates like: template<class T> inline T pi_lower() does

> not work at least on MSVC. Use class specializations instead.
> I know that function templates like
> template<typename T>
> void foo() {
> ...
> }
> produces wrong specialization with MSVC.

FWIW, the correct specialization gets instantiated and compiled. It is
actually a name mangling problem. With vc6 name mangling the template
arguments are not part of the mangled name. As a result the linker can
differentiate between foo<int>() and foo<double>(). The usual workaround
to do something like this.

template <class T>
foo(T* = 0) {}


Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001
Unsubscribe & other changes:

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