Hi,
while trying to compile libcvd/GVars3 on Windows (x64, Visual Studio
2008) I encountered a nasty problem in operators.hh, lines 60 to 63. The
compilation died with the following error:
1>C:\dev\Libraries\TooN\TooN/internal/operators.hh(60) : warning C4346:
'boost::type_of::msvc_typeid_wrapper<sizeof(disable_if<is_function<T>::type,sizer<T>::type>::type)>::type'
: dependent name is not a type
1> prefix with 'typename' to indicate a type
1> C:\dev\Libraries\TooN\TooN/internal/operators.hh(60) : see
reference to class template instantiation
'TooN::Internal::AddType<L,R,F>' being compiled
1>C:\dev\Libraries\TooN\TooN/internal/operators.hh(60) : error C2146:
syntax error : missing ';' before identifier 'type'
1>C:\dev\Libraries\TooN\TooN/internal/operators.hh(60) : error C4430:
missing type specifier - int assumed. Note: C++ does not support default-int
The line being:
template<class L, class R, int F = Field<L,R>::is> struct AddType {
typedef TOON_TYPEOF(gettype<L>()+gettype<R>()) type;};
Turns out error C4346 is a feature "in order to conform to the ISO C++
standard."
The solution is to add the "typename" keyword so that the line reads