<div class="gmail_quote">2011/10/23 Howard Hinnant <span dir="ltr"><<a href="mailto:hhinnant@apple.com" target="_blank">hhinnant@apple.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div>On Oct 22, 2011, at 6:52 PM, Aaron Ballman wrote:<br>
<br>
> On Sat, Oct 22, 2011 at 5:48 PM, Howard Hinnant <<a href="mailto:hhinnant@apple.com" target="_blank">hhinnant@apple.com</a>> wrote:<br>
>> On Oct 22, 2011, at 6:29 PM, Ruben Van Boxem wrote:<br>
>><br>
>>> OK, attached is a renewed fixed up preprocessed source that gets accepted by Clang and GCC (once you specify -std=c++0x of course <slaps himself on forehead>), but rejected by MSVC 10. I don't assume there's any other way to write this kind of construct, preserving the functionality?<br>
>>><br>
>>> I'll take it to MS next. This sucks for libc++ and MSVC...<br>
>><br>
>> What's the first error message for MSVC 10?<br>
><br>
> Here's what I get:<br>
><br>
> 1>c:\users\aaron ballman\desktop\algorithm.cpp(129): error C2516:<br>
> 'std::common_type<_Tp>::type' : is not a legal base class<br>
> 1> with<br>
> 1> [<br>
> 1> _Tp=<br>
> 1> ]<br>
> 1> c:\users\aaron ballman\desktop\algorithm.cpp(101) : see<br>
> declaration of 'std::common_type<_Tp>::type'<br>
> 1> with<br>
> 1> [<br>
> 1> _Tp=<br>
> 1> ]<br>
> 1> c:\users\aaron ballman\desktop\algorithm.cpp(129) : see<br>
> reference to class template instantiation<br>
> 'std::__is_assignable_imp<_Tp,_Arg,__formal>' being compiled<br>
><br>
> ~Aaron<br>
<br>
</div></div>It looks to me like the derivation should be from either false_type or true_type, both of which are legal to derive from. <shrug><br></blockquote><div><br>Yeah, indeed, <shrug> :). There are reports on the internet that decltype is buggy in MSVC 10. I'll see if I can try MSVC 11 (Developer preview) and see where that gets me.<br>
<br>For reference, the bug report submitted to MS is here (feel free to "upvote" it if you can ;-):<br><a href="https://connect.microsoft.com/VisualStudio/feedback/details/696201/template-c-11-code-being-rejected-although-it-is-correct" target="_blank">https://connect.microsoft.com/VisualStudio/feedback/details/696201/template-c-11-code-being-rejected-although-it-is-correct</a><br>
<br>I am now attempting to use MSVC based Clang, and it seems to work better, if I do this to CMAKE_CXX_FLAGS:<br>-nostdinc -I"M:\Development\Source\libc++\include" -I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" -I"C:\Program Files\Microsoft SDKs\Windows\v7.1\Include"<br>
<br>I'll run into a missing pthreads soon enough (although I can use on pthreads-win32 when it comes to that). More patches coming up (oh, yes, there are even more missing functions in Visual Studio headers, what a surprise!)<br>
<br>Ruben<br></div></div>