|
From: | E. Scott Larsen |
Subject: | Re: [Openexr-devel] OpenEXR Windows port |
Date: | Fri, 24 Jan 2003 17:26:57 -0500 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130 |
Dustin Graves wrote:
Luc-Eric Rousseau wrote:> -----Original Message----- > From: Dustin Graves [mailto:address@hidden > > Last night I did a rough port to Windows with Visual Studio 6 + Intel > 5.0 Compiler. I was unable to use the compilers provided with both > Visual Studio 6.0 and .NET because they do not recognize this > as legal syntax: > > template <class T> > template <class S> > inline bool > Vec2<T>::operator != (const Vec2<S> &v) const > ... > The template followed by a template causes a syntax error. This is a > bug with the compiler, which I'll try reporting to Microsoft. try template <class T, class S>, should be the sameI'd tried this, but these actually aren't the same thing. A template parameter list of a template and its template member cannot be conbined, so there isn't going to be a simple work around for this with the current Microsoft compiler.
exactly right, they're not the same. The work around is to inline the implementation. ugly, but it works for MSVC. Eg:
template <class T> class A { template <class S> void f(){ //code goes here } }since yes, MS acknoledges that there is no workaround for their bug that would not let you do:
template <class T> class A { template <class S> void f(); } template <class T> template <class S> void A<T>::f(){ //code here } this is in some docs on their page somewhere, don't remember. //Scott
> 3. std::min and std::max are unavailable (due to conflict > with min and > max in windefs.h), so std::_MIN and std::_MAX are provided instead. When you need to include windows.h, use #define NOMINMAX before including it. See windef.h. you may also #define WIN32_LEAN_AND_MEAN to speed up compile.The problem here is that std::min and std::max do not seem to exist with VC6. They are provided with VC .NET, but with VC6 they are renamed to _cpp_min and _cpp_max and then #defined to _MIN and _MAX.> 5. Scoping error with variable declarations within 'for' loops, > resulting in multiple defines, required variables to be > declared outside > of the 'for' loop, once per function. I'm not too fond of the new scoping rule, but you can enable it in VC++ 6.0 with "Disable language extensions", in the compiler settings. It's off by default because it breaks existing code, in some cases silently.This works nicely. I will update the project files to include this setting._______________________________________________ Openexr-devel mailing list address@hidden http://mail.nongnu.org/mailman/listinfo/openexr-devel
[Prev in Thread] | Current Thread | [Next in Thread] |