Boost logo

Boost Users :

From: Frank (opcode_at_[hidden])
Date: 2005-11-07 14:51:42


John Maddock <john <at> johnmaddock.co.uk> writes:

> It's a weird error: I don't believe that the compiler should be
> instantiating those methods at all, but <shrug>.

I don't have access to any other compilers so don't know if it's a VStudio
problem.

> Partial specialisation works just fine in Visual Studio 2003 (VC7.1 and
> later).

I could never get it to work but it may be my lack of understanding even tho I
looked at dozens of examples.

>
> > Soln 3) I like this one but haven't made it work yet. It succeeds if
> > I export the specialized Vector<T,DIM>::Normal() but not if I export
> > Vector3<T>::Normal () but i'm working on it
>
> Your right, I've just tried it out, and it leads to even stranger errors:
> the template members get instantiated with some really strange argument
> types, I've no idea what's going on there at present.

I converted my template hierarchy to get rid of the Vector3<T> derivation
and added the "low Dim" ctor's to the Vector<T,DIM> template. But I couldn't
use the template <typename U> member templates approach because I have other
ctor's with 2 parameters and the wrong one was getting used.

ie:
i have a ctor:
Vector( Point<T,DIM> from, Point<T,DIM> to){}

when I write Vector<double,3> v(Point<double,3>(...), Point<double,3>(...) )

"it" would try to construct v using
template <typename U> Vector( U x, U y ){...}

I've essentially given up for now and resorted to runtime check using
BOOST_ASSERT.

Thanks for the assistance
Frank


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net