|
From: | Gerhard Reitmayr |
Subject: | Re: [Toon-members] TooN slice<0,End<-1>> problem in MSVC++ |
Date: | Mon, 2 Nov 2009 15:53:28 +0100 |
On 2 Nov 2009, at 13:12, E. Rosten wrote:
On Sat, 31 Oct 2009, Gerhard Reitmayr wrote:ok, I have a short term solution :)End is only used in project/unproject functions in TooN. so I rewrote them to use the general slice functions and put ifdefs around the slices members with End markers to not be used under Win32...I will check that in, if that is acceptable for now.That's fine. I'll delete the feature. I wasn't too fond of it since it required rather nasty evaluation of all available slices.
sure. I also just realized something else, the End<X> notation and the usual slice notation use different semantics...
slice<start, length>() vs slice<start, end_position>() // End<-1> encodes an end position not sure how they should be reconciled anyway ?
Any ideas for a good replacement?
not really. I tried playing around with constructions similar to yours but didn't find any.
cheers, Gerhard
-Edcheers, Gerhard On 31 Oct 2009, at 00:22, Gerhard Reitmayr wrote:Hi guys,There is a problem with the nice new End<X> notation and MSVC++ (yeah latest version).basically, it accepts the construct and swallows the slice<X, End<Y> >() but does not resolve the original one slice<X,Y>()anymore. It tries to match it against the first one and fails (no casting of int to End<Y>).Basically, the following simple test case fails: template <int A, int B> int f() { return A; } template <int X> struct S {}; template <int X> S<X> End(); template <int A, S<2> (*End)() > int f() { return 2; } void bla(){ f<1,2>(); // this one doesn't work f<1, End<2> >(); } not sure what to do about this one? cheers, Gerhard -- Gerhard Reitmayr MIL, Engineering Department, Cambridge University http://mi.eng.cam.ac.uk/~gr281/ _______________________________________________ Toon-members mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/toon-members-- Gerhard Reitmayr MIL, Engineering Department, Cambridge University http://mi.eng.cam.ac.uk/~gr281/ _______________________________________________ Toon-members mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/toon-members-- (You can't go wrong with psycho-rats.)(http://mi.eng.cam.ac.uk/~er258) /d{def}def/f{/Times s selectfont}d/s{11}d/r{roll}d f 2/m{moveto}d -1 r 230 350 m 0 1 179{ 1 index show 88 rotate 4 mul 0 rmoveto}for/s 12 d f pop 235 420 translate 0 0 moveto 1 2 scale show showpage
-- Gerhard Reitmayr MIL, Engineering Department, Cambridge University http://mi.eng.cam.ac.uk/~gr281/
[Prev in Thread] | Current Thread | [Next in Thread] |