BOOST_NO_CXX11_CONSTEXPR and msvc-14.0
I see that BOOST_NO_CXX11_CONSTEXPR is no longer being defined for
msvc-14.0. Even the RTM version has spotty support for constexpr though; the
techniques in my metaprogramming article, for example, don't work. One
simple example that fails is
#include
I think VC14 also has a less conforming std::alignment_of than VC12. I wonder if this is an isolated thing, or if BOOST_NO_CXX11_HDR_TYPE_TRAITS is not granular enough. -- View this message in context: http://boost.2283326.n4.nabble.com/BOOST-NO-CXX11-CONSTEXPR-and-msvc-14-0-tp... Sent from the Boost - Dev mailing list archive at Nabble.com.
[glenfe]
I think VC14 also has a less conforming std::alignment_of than VC12.
Not to my knowledge, and I maintain the thing. We're now implementing alignment_of with the compiler's alignof (instead of library machinery) and as far as I know, alignof returns perfect answers. If you have examples otherwise, I'd like to see them. Note that aligned_storage is still powered by imperfect library tech (unchanged since 2013) because the compiler's alignas doesn't permit highly-aligned objects to be passed by value. STL
Stephan T. Lavavej wrote
Not to my knowledge, and I maintain the thing. We're now implementing alignment_of with the compiler's alignof (instead of library machinery) and as far as I know, alignof returns perfect answers. If you have examples otherwise, I'd like to see them.
Only what was reported for the RC:
1. For x86 and x64: std::alignment_ofstd::nullptr_t::value is 1, yet
compiler aligns at 4
2. For x86: std::alignment_of
[Glen Fernandes]
Only what was reported for the RC:
Was this reported on Connect? I didn't see any bug reports filed against the STL.
1. For x86 and x64: std::alignment_ofstd::nullptr_t::value is 1, yet compiler aligns at 4 2. For x86: std::alignment_of
::value is 4, yet compiler aligns at 8 For x64: std::alignment_of ::value is 8, yet compiler aligns at 4 3. For x86: std::alignment_of ::value is 4, yet compiler aligns at 8 For x64: std::alignment_of ::value is 8, yet compiler aligns at 4
I am observing discrepancies with nullptr_t on x86/x64 and PMDs on x64 only, but not with PMFs. I've filed DevDiv#1202506 "alignof reports inaccurate values" with the repro at the end of this mail. If you can demonstrate x86 PMD failure, or x86/x64 PMF failure, I'll add that to the bug report.
I haven't checked the RTM yet, but apparently VC12's std::alignment_of for the relevant types reported the same value that the compiler chose to align objects of those types.
Yeah, that's because 2013 used library-only tech, and 2015 uses alignof as required/depicted by the Standard.
Thanks,
STL
C:\Temp>type meow.cpp
#ifdef _MSC_VER
#pragma warning(disable: 4127) // conditional expression is constant
#endif
#include
Stephan T. Lavavej wrote:
Was this reported on Connect? I didn't see any bug reports filed against the STL.
I don't know if it was reported on Connect; it was reported to me, along with a few other library bugs in VC14.
I've filed DevDiv#1202506 "alignof reports inaccurate values" with the repro at the end of this mail.
To be fixed in VC15? :-)
If you can demonstrate x86 PMD failure, or x86/x64 PMF failure, I'll add that to the bug report.
Replacing "struct Meow { };" with "struct Meow;" and on x86 I see: nullptr_t AlignmentOf<T>::value = 4 alignof(T) = 1 <== FAIL PMD AlignmentOf<T>::value = 8 alignof(T) = 4 <== FAIL PMF AlignmentOf<T>::value = 8 alignof(T) = 4 <== FAIL While on x64 with that same change I see: nullptr_t AlignmentOf<T>::value = 8 alignof(T) = 1 <== FAIL PMD AlignmentOf<T>::value = 4 alignof(T) = 8 <== FAIL PMF AlignmentOf<T>::value = 8 alignof(T) = 8 Glen
[Glen Fernandes]
I don't know if it was reported on Connect; it was reported to me, along with a few other library bugs in VC14.
You really need to report this stuff to Microsoft. If you don't, you're making your life and our lives harder.
I've filed DevDiv#1202506 "alignof reports inaccurate values" with the repro at the end of this mail.
To be fixed in VC15? :-)
I don't understand what your smiley face is trying to imply. This bug is currently targeted for Dev14 Update 1, although we can't promise anything yet (it may have to be delayed to a future Update, or Dev15). Had it been reported a couple of months ago, we could have probably fixed it for Dev14 RTM, or I could have reworked alignment_of to go back to the library-only tech.
Replacing "struct Meow { };" with "struct Meow;" and on x86 I see:
Thanks, I've added this to the bug report. STL
Stephan T. Lavavej wrote:
You really need to report this stuff to Microsoft. If you don't, you're making your life and our lives harder.
No. My life is actually not impacted by VC14 having library bugs that were not fixed before RTM.
I've filed DevDiv#1202506 "alignof reports inaccurate values" with the repro at the end of this mail. To be fixed in VC15? :-) I don't understand what your smiley face is trying to imply.
You really need to not read too much into a smiley face.
Had it been reported a couple of months ago, we could have probably fixed it for Dev14 RTM, or I could have reworked alignment_of to go back to the library-only tech.
boost::alignment::alignment_of for Boost 1.59+ should work fine for VC14 users who may be bothered by the broken alignof.
Thanks, I've added this to the bug report.
You're welcome. Glen -- View this message in context: http://boost.2283326.n4.nabble.com/BOOST-NO-CXX11-CONSTEXPR-and-msvc-14-0-tp... Sent from the Boost - Dev mailing list archive at Nabble.com.
On Tue, Jul 21, 2015 at 4:48 PM, Peter Dimov
I see that BOOST_NO_CXX11_CONSTEXPR is no longer being defined for msvc-14.0. Even the RTM version has spotty support for constexpr though; the techniques in my metaprogramming article, for example, don't work.
Given that constexpr was still undergoing development between RC and RTM, it isn't surprising that there are still problems. Are the problems so serious we should continue to define BOOST_NO_CXX11_CONSTEXPR? Remember that the usual criteria for defining a BOOST_NO_WHATEVER macro is that the problem impacts Boost library code. So even if there are some bugs in the implementation of a C++11 feature, if they are not impacting Boost libraries, we usually don't bother to define the macro. Given we are so late in the 1.59 release cycle, we may want to leave BOOST_NO_CXX11_CONSTEXPR defined in master until after 1.59 ships to be conservative. --Beman
On 22.07.2015 14:02, Beman Dawes wrote:
On Tue, Jul 21, 2015 at 4:48 PM, Peter Dimov
wrote: I see that BOOST_NO_CXX11_CONSTEXPR is no longer being defined for msvc-14.0. Even the RTM version has spotty support for constexpr though; the techniques in my metaprogramming article, for example, don't work.
Given that constexpr was still undergoing development between RC and RTM, it isn't surprising that there are still problems. Are the problems so serious we should continue to define BOOST_NO_CXX11_CONSTEXPR?
Remember that the usual criteria for defining a BOOST_NO_WHATEVER macro is that the problem impacts Boost library code. So even if there are some bugs in the implementation of a C++11 feature, if they are not impacting Boost libraries, we usually don't bother to define the macro.
Boost.Config macros are also used in users' projects, so it's better to have them defined correctly even if the compiler flaw does not affect Boost libraries.
Given we are so late in the 1.59 release cycle, we may want to leave BOOST_NO_CXX11_CONSTEXPR defined in master until after 1.59 ships to be conservative.
+1, I think this would be the correct decision.
Given we are so late in the 1.59 release cycle, we may want to leave BOOST_NO_CXX11_CONSTEXPR defined in master until after 1.59 ships to be conservative.
+1, I think this would be the correct decision.
+2. I've reinstated that macro in develop for now, let's revisit this when VC14 is released and we have more time to figure out the consequences of enabling constexpr support. John.
On Wed, Jul 22, 2015 at 1:02 PM, John Maddock
Given we are so late in the 1.59 release cycle, we may want to leave
BOOST_NO_CXX11_CONSTEXPR defined in master until after 1.59 ships to be conservative.
+1, I think this would be the correct decision.
+2.
I've reinstated that macro in develop for now, let's revisit this when VC14 is released and we have more time to figure out the consequences of enabling constexpr support.
It shipped Monday. See http://blogs.msdn.com/b/vcblog/archive/2015/07/20/visual-studio-2015-rtm-now... Also https://msdn.microsoft.com/en-us/library/hh567368.aspx --Beman
I've reinstated that macro in develop for now, let's revisit this when VC14 is released and we have more time to figure out the consequences of enabling constexpr support.
It shipped Monday.
See http://blogs.msdn.com/b/vcblog/archive/2015/07/20/visual-studio-2015-rtm-now...
Thanks, got it. Just made one last tweak to Boost.Config (VC14 still doesn't quite handle value initialization correctly), once the dust has settled there should be just enough time to merge to master I hope. John.
On Thu, Jul 23, 2015 at 4:57 AM, John Maddock
I've reinstated that macro in develop for now, let's revisit this when
VC14 is released and we have more time to figure out the consequences of enabling constexpr support.
It shipped Monday.
See
http://blogs.msdn.com/b/vcblog/archive/2015/07/20/visual-studio-2015-rtm-now...
Thanks, got it. Just made one last tweak to Boost.Config (VC14 still doesn't quite handle value initialization correctly), ...
Do file a Connect bug report. Filing bug reports is much more rewarding than it used to be - responses in days instead of years, and the roughly quarterly updates to the production compiler mean the fixes make a real difference. Mention that the bug is impacting Boost code, as this seems to bump the priority up a bit. http://blogs.msdn.com/b/vcblog/archive/2015/07/01/c-compiler-front-end-fixes... documents 750 bug reports from users that were fixed in VC++ 2015. You will see a lot of familiar names - Marcel Raad had an even dozen fixes, most or all Boost related. --Beman
Do file a Connect bug report. Filing bug reports is much more rewarding than it used to be - responses in days instead of years, and the roughly quarterly updates to the production compiler mean the fixes make a real difference. Mention that the bug is impacting Boost code, as this seems to bump the priority up a bit.
I will, however, this bug has been reported at least 3 times already, closed variously as "won't fix" or "fixed" - and indeed it was fixed at one point in VC14 pre-release - and then seems to have regressed again for the final release :( John.
John Maddock
I will, however, this bug has been reported at least 3 times already, closed variously as "won't fix" or "fixed" - and indeed it was fixed at one point in VC14 pre-release - and then seems to have regressed again for the final release :(
It seems there were several bugs with value initialization and the only one not fixed in RTM is this one about pointers to data members: https://connect.microsoft.com/VisualStudio /feedback/details/956553/
Beman Dawes
On Tue, Jul 21, 2015 at 4:48 PM, Peter Dimov
wrote:
I see that BOOST_NO_CXX11_CONSTEXPR is no longer being defined for msvc-14.0. Even the RTM version has spotty support for constexpr though; the techniques in my metaprogramming article, for example, don't work.
Given that constexpr was still undergoing development between RC and RTM, it isn't surprising that there are still problems. Are the problems so serious we should continue to define BOOST_NO_CXX11_CONSTEXPR?
Remember that the usual criteria for defining a BOOST_NO_WHATEVER macro is that the problem impacts Boost library code.
Unfortunately it seems this is the case here, TypeErasure's regression tests don't compile with constexpr support enabled: e:\boost\boost/type_erasure/detail/vtable.hpp(169): error C4579: '[...]' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported There's also this compile error all over the place, which seems to be a bug in Boost.Chrono rather than in MSVC: e:\boost\boost/chrono/duration.hpp(440): error C2476: 'constexpr' constructor does not initialize all members e:\boost\boost/chrono/duration.hpp(433): note: 'boost::chrono::duration<__int64,boost::ratio<0x01,0x071>>::rep_' was not initialized by the constructor
On 21 Jul 2015 at 23:48, Peter Dimov wrote:
I see that BOOST_NO_CXX11_CONSTEXPR is no longer being defined for msvc-14.0. Even the RTM version has spotty support for constexpr though; the techniques in my metaprogramming article, for example, don't work.
I turned on constexpr for VS2015 for all my own code to see what happens. VS2015 RC couldn't compile my code with constexpr on, but I'm glad to report that with a bit of minor rejigging of code VS2015 successfully compiles everything I've got with C++ 11 constexpr enabled. The minor rejigging was a bit silly. For example, I had a constructor like this: class A; class B : public A { B() = default; constexpr B(int) : B() { } }; ... and VS2015 barfed about the B(int) not properly initialising all base classes, even though it is via a delegation to the defaulted constructor. The simple fix was: constexpr B(int) : A() { } Another example was this: template<class T> class Foo { union { T a; std::error_code b; std::exception_ptr c; } int d; constexpr Foo() : d(5) { } }; VS2015 didn't like that the union wasn't being initialised, despite that clang and GCC were happy with it. I think VS2015 is being correct here actually, the standard seems pretty clear I should have been initialising something. I worked around it like this: template<class T> class Foo { struct constexpr_standin_type { }; union { T a; std::error_code b; std::exception_ptr c; constexpr_standin_type standin; } int d; constexpr Foo() : standin(), d(5) { } }; ... and now VS2015 is happy. All these are minor annoyances really, but until Boost code is similarly rejigged to fit with VS2015's interpretation of constexpr I wouldn't enable constexpr by default for 1.59. Straight after release is the right time I think. And my hat is off to the Visual Studio team for doing such a great job with VS2015 which really is a very conforming C++ 11 compiler now. I'm finally beginning to run into things older GCCs and clangs won't compile that VS2015 will, and that's *amazing*. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Niall Douglas:
I'm finally beginning to run into things older GCCs and clangs won't compile that VS2015 will, and that's *amazing*.
I don't know if it's so amazing that version of VC released only days ago [and almost two years after its predecessor] can compile things that other compilers released more than a year ago [and who release much more frequently] could not. (Unless that was humor or a jibe at VC for its track record of conformance). Glen -- View this message in context: http://boost.2283326.n4.nabble.com/BOOST-NO-CXX11-CONSTEXPR-and-msvc-14-0-tp... Sent from the Boost - Dev mailing list archive at Nabble.com.
On 23 Jul 2015 at 4:21, Glen Fernandes wrote:
I'm finally beginning to run into things older GCCs and clangs won't compile that VS2015 will, and that's *amazing*.
I don't know if it's so amazing that version of VC released only days ago [and almost two years after its predecessor] can compile things that other compilers released more than a year ago [and who release much more frequently] could not.
(Unless that was humor or a jibe at VC for its track record of conformance).
No, it's entirely serious. But then I'm a fan of MSVC and especially the team they have behind it whom are all seriously impressive engineers at least out of the ones I've met. MSVC has lots of outstanding features no other compiler has: * It's vastly faster to compile, like 5x-10x faster as it's not an AST based compiler like clang and GCC. * It has the best debugger in the business, and still far outclasses anything in the GCC/clang ecosystem. I still develop for Visual Studio first because of that debugger and IDE which also debugs Python very well indeed. * It generates some very unique assembler which still beats the assembler coming out of clang/LLVM, though it has fallen behind GCC in recent years. * It has a totally unique interpretation of the C++ standard. * It's the last full stack compiler ecosystem left, and a major bulwark against a clang monoculture. My only criticism about the compiler really is it accepts too much C++ 11/14 which won't compile on GCC nor clang, so I am still forced to run several passes of mingw-w64 from the command line before each git commit of new code. If Visual Studio had a switch for the EDG red underlining tool to switch on "don't pretend to be MSVC" in the IDE I'd be very pleased, it would save me a lot of time. Even better of course if Visual Studio dual compiled your code with both MSVC and winclang and gave you a combined set of warnings. I'd also like if Visual Studio could make use of the clang-tidy lint tool. Since Chandler turned me onto that tool I've found it remarkably useful for catching accidental slip ups. But all these are minor things. VS2015 is by far the best Visual Studio ever, and that's what matters. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
No, it's entirely serious. But then I'm a fan of MSVC and especially the team they have behind it whom are all seriously impressive engineers at least out of the ones I've met. MSVC has lots of outstanding features no other compiler has:
* It's vastly faster to compile, like 5x-10x faster as it's not an AST based compiler like clang and GCC.
I find this claim interesting because in my (anecdotal) experience over the past few years, MSVC is significantly slower than Clang. It seems to be generally accepted that MSVC is the fastest, but that is just not my experience.
* It generates some very unique assembler which still beats the assembler coming out of clang/LLVM, though it has fallen behind GCC in recent years.
This is also contrary to my experience. I find that generally both clang and gcc generate better code on a more consistent basis. -- chris
In the benchmarks of my sort algorithms, the same code, the same input
data, running on the same machine. With VC++ 2015 need the double of time
than with GCC 4.9.
El 23/07/2015 21:27, "Chris Glover"
No, it's entirely serious. But then I'm a fan of MSVC and especially the team they have behind it whom are all seriously impressive engineers at least out of the ones I've met. MSVC has lots of outstanding features no other compiler has:
* It's vastly faster to compile, like 5x-10x faster as it's not an AST based compiler like clang and GCC.
I find this claim interesting because in my (anecdotal) experience over the past few years, MSVC is significantly slower than Clang. It seems to be generally accepted that MSVC is the fastest, but that is just not my experience.
* It generates some very unique assembler which still beats the assembler coming out of clang/LLVM, though it has fallen behind GCC in recent years.
This is also contrary to my experience. I find that generally both clang and gcc generate better code on a more consistent basis.
-- chris
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
On 23 July 2015 at 21:26, Chris Glover
No, it's entirely serious. But then I'm a fan of MSVC and especially the team they have behind it whom are all seriously impressive engineers at least out of the ones I've met. MSVC has lots of outstanding features no other compiler has:
* It's vastly faster to compile, like 5x-10x faster as it's not an AST based compiler like clang and GCC.
I find this claim interesting because in my (anecdotal) experience over the past few years, MSVC is significantly slower than Clang. It seems to be generally accepted that MSVC is the fastest, but that is just not my experience.
I'm also surprised with this statement (as a msvc-first user but still use clang and gcc regularly, but on linux). Maybe Niall meant mingw instead of gcc. I don't know how to compare msvc with clang on windows, last time I checked clang was not ready for production so it wouldn't be a fair comparison. There also seems to be very different performance characteristics depending on the kind of code (metaprog, etc.) from the different compilers so maybe Niall is in a very specific context.
Niall Douglas wrote:
No, it's entirely serious. But then I'm a fan of MSVC and especially the team [...]
I get that impression, yes. :-)
It has the best debugger in the business, and still far outclasses anything in the GCC/clang ecosystem
It's interesting you say this. At least one team I was in during my 5+ years at Microsoft elected to (or in some cases had to) use WinDbg over the VS debugger.
It has a totally unique interpretation of the C++ standard
This sounds almost dangerous - like commending a criminal for having a unique interpretation of the law. :-) I thought we prefer compilers to have a correct interpretation of the standard.
It's vastly faster to compile, like 5x-10x faster as it's not an AST based compiler like clang and GCC.
This is interesting. Which (preferably public-available open source) project(s) have you compiled with all three, and what were the build times? Glen -- View this message in context: http://boost.2283326.n4.nabble.com/BOOST-NO-CXX11-CONSTEXPR-and-msvc-14-0-tp... Sent from the Boost - Dev mailing list archive at Nabble.com.
On 23 Jul 2015 at 14:15, Glen Fernandes wrote:
It has the best debugger in the business, and still far outclasses anything in the GCC/clang ecosystem
It's interesting you say this. At least one team I was in during my 5+ years at Microsoft elected to (or in some cases had to) use WinDbg over the VS debugger.
As have I in the past. The VS debugger isn't an end all be all debugger, it's just very good at what it's good at. Edit and Continue is a major boon, but for obvious reasons can't work in many places.
It has a totally unique interpretation of the C++ standard
This sounds almost dangerous - like commending a criminal for having a unique interpretation of the law. :-) I thought we prefer compilers to have a correct interpretation of the standard.
Microsoft can read a standard just as well as anyone, and that's exactly where the value add comes from - the same text means different thing to different people. Correctness is relative. Imagine a world with just clang and GCC. Firstly, clang would utterly destroy GCC in short order as it's so much easier to modify and evolve, so then it would be just clang. Then there would no longer be much need for a C++ standard at all, because whatever clang does IS the standard. Even the lead clang engineers get a bit uncomfortable with that idea. They'd prefer someone not them to bounce against their decisions and interpretations against, even if that is infuriating sometimes. I can't think of a better team to do that than the Visual Studio team.
It's vastly faster to compile, like 5x-10x faster as it's not an AST based compiler like clang and GCC.
This is interesting. Which (preferably public-available open source) project(s) have you compiled with all three, and what were the build times?
It depends on if you use precompiled headers or not. I would assume anyone sane in Boost-land does. https://svn.boost.org/trac/boost/wiki/BestPracticeHandbook#a16.BUILD:C onsiderdefaultingtoheaderonlybutactivelymanagefacilitiesforreducingbui ldtimes for some empirical numbers. tl;dr about 2x faster in debug than clang, about 3x faster in release than clang. clang itself is 2x faster than GCC in debug. AFIO is very easy on the compiler as it's a tiny simple library. The more templates you feed it, the relatively faster MSVC becomes because it doesn't do two phase lookup i.e. it completely ignores template code until instantiation and neither clang nor GCC do that. Lightweight future-promise is much harder on the compiler, and the differential in release mode is about 6x which is enough I very rarely test in release mode (I let the CI do it for me). If you don't use precompiled headers, or don't have lots of test executables to compile, clang and MSVC are about equal on average in my experience. Perhaps this explains our divergent experiences? Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
On 24.07.2015 19:45, Niall Douglas wrote:
On 23 Jul 2015 at 14:15, Glen Fernandes wrote:
This sounds almost dangerous - like commending a criminal for having a unique interpretation of the law. :-) I thought we prefer compilers to have a correct interpretation of the standard.
Microsoft can read a standard just as well as anyone, and that's exactly where the value add comes from - the same text means different thing to different people. Correctness is relative.
Imagine a world with just clang and GCC. Firstly, clang would utterly destroy GCC in short order as it's so much easier to modify and evolve, so then it would be just clang. Then there would no longer be much need for a C++ standard at all, because whatever clang does IS the standard.
Competition is good, on that I agree with you. But I don't think MSVC is the compiler that drives the competition currently. If anything, this compiler, being the main compiler on Windows, has been an absolute embarrassment in terms of language support for many years. It still is in several areas, even though it's catching up and VS2015 claims to support C++11 and C++14 more fully. As for clang, I've surely been hearing that it is about to conquer the world for the last several years but I don't see that happening. I don't think it would even in the absence of MSVC. All that does not diminish the efforts of each dev team. I'm pleased to see that MS is trying to improve their compiler at a faster pace and with more frequent releases.
It's vastly faster to compile, like 5x-10x faster as it's not an AST based compiler like clang and GCC.
This is interesting. Which (preferably public-available open source) project(s) have you compiled with all three, and what were the build times?
It depends on if you use precompiled headers or not. I would assume anyone sane in Boost-land does.
I didn't research this but my impression has always been that precompiled headers mostly hide the slowness of the Windows filesystem. When I was building natively on Windows, I noticed that the same code compiled with MinGW on Windows much more slowly than with gcc on Linux, on the same machine.
https://svn.boost.org/trac/boost/wiki/BestPracticeHandbook#a16.BUILD:C onsiderdefaultingtoheaderonlybutactivelymanagefacilitiesforreducingbui ldtimes for some empirical numbers. tl;dr about 2x faster in debug than clang, about 3x faster in release than clang. clang itself is 2x faster than GCC in debug.
AFIO is very easy on the compiler as it's a tiny simple library. The more templates you feed it, the relatively faster MSVC becomes because it doesn't do two phase lookup i.e. it completely ignores template code until instantiation and neither clang nor GCC do that.
I can't see how a non-conforming behavior is an advantage.
On 24 Jul 2015 at 21:46, Andrey Semashev wrote:
Competition is good, on that I agree with you. But I don't think MSVC is the compiler that drives the competition currently.
I personally think you're very wrong on this. I think there is a "two speed" C++ ecosystem. The largest which is the "slow ring" is paced by the lowest common denominator, and that is MSVC. Therefore VS2015 is the most important release of Visual Studio for all C++ users since VS2003 (which was the first to implement most of C++ 98). VS2015 is the release which fires the gun on no C++ programmer writing C++ 03 code any more. If you even look at the Boost usership, there is a ton of people still on VS2005. That's because later VS's didn't offer anything new which was compelling for a C++ user. A quick informal straw poll at C++ Now found almost all of these had been experimenting with VS2015 CTP and were expecting to jump straight to VS2015. So how does this drive the competition? Because clang can't push too far ahead of the majority. And MSVC sets what the majority is.
If anything, this compiler, being the main compiler on Windows, has been an absolute embarrassment in terms of language support for many years. It still is in several areas, even though it's catching up and VS2015 claims to support C++11 and C++14 more fully.
VS2015 has about clang 3.3 levels of C++ 11 and 14.
As for clang, I've surely been hearing that it is about to conquer the world for the last several years but I don't see that happening. I don't think it would even in the absence of MSVC.
clang's development has slowed recently because of Modules and MSVC compatibility. Once those two have cleared (they are both enormously hard), pace will pick up again.
All that does not diminish the efforts of each dev team. I'm pleased to see that MS is trying to improve their compiler at a faster pace and with more frequent releases.
They delivered a new C++ spec in four years as compared to five years with the C++ 98 standard. That's 20% faster!
It's vastly faster to compile, like 5x-10x faster as it's not an AST based compiler like clang and GCC.
This is interesting. Which (preferably public-available open source) project(s) have you compiled with all three, and what were the build times?
It depends on if you use precompiled headers or not. I would assume anyone sane in Boost-land does.
I didn't research this but my impression has always been that precompiled headers mostly hide the slowness of the Windows filesystem.
That doesn't explain the benchmarks I posted though where I was comparing MSVC on Windows to clang and GCC on Linux.
When I was building natively on Windows, I noticed that the same code compiled with MinGW on Windows much more slowly than with gcc on Linux, on the same machine.
Correct. This is because GCC uses the stat() call to search header path locations for the existence of a file. The stat() call requires seven syscalls on Windows to synthesise the information, none of which is actually used by GCC. If you manually pare down the locations it searches you'll see a corresponding improvement in speed. I patched clang for the BB10/QNX dev stack to use PathFileExists() on Windows and saw a 40% performance improvement :)
https://svn.boost.org/trac/boost/wiki/BestPracticeHandbook#a16.BUILD:C onsiderdefaultingtoheaderonlybutactivelymanagefacilitiesforreducingbui ldtimes for some empirical numbers. tl;dr about 2x faster in debug than clang, about 3x faster in release than clang. clang itself is 2x faster than GCC in debug.
AFIO is very easy on the compiler as it's a tiny simple library. The more templates you feed it, the relatively faster MSVC becomes because it doesn't do two phase lookup i.e. it completely ignores template code until instantiation and neither clang nor GCC do that.
I can't see how a non-conforming behavior is an advantage.
I know what you mean. Still, in practical terms I don't much like waiting around to see if my new code works, and MSVC delivers that for me. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Andrey spaketh:
Competition is good, on that I agree with you. But I don't think MSVC is the compiler that drives the competition currently.
Niall respondeth:
I personally think you're very wrong on this.
On 7/25/15 8:42 AM, Niall Douglas wrote:
Therefore VS2015 is the most important release of Visual Studio for all C++ users since VS2003 (which was the first to implement most of C++ 98). VS2015 is the release which fires the gun on no C++ programmer writing C++ 03 code any more.
If you even look at the Boost usership, there is a ton of people still on VS2005. That's because later VS's didn't offer anything new which was compelling for a C++ user. A quick informal straw poll at C++ Now found almost all of these had been experimenting with VS2015 CTP and were expecting to jump straight to VS2015.
Nothing is further from the truth. I can't remember all the language features introduced between vs2005 and 2015 but just rvalue refs, lambda's, variadic templates and macros are surely compelling enough. The main problem of MSVS is that they've had their niche market cornered ever since the very first, eye-opening version of Visual Studio came out. The dominance has hurt them ever since. Just like it has IExplorer. I do very much appreciate their efforts to keep up with the other compilers, but compared to clang and gcc, it's a crappy compiler any way (featurewise, compile time-wise, optimization-wise, etc) you look at it. That being said, their debugger, and to a lesser extent IDE, have no equals, although lack of competition has hurt there too.
[Niall Douglas]
B() = default; constexpr B(int) : B() { } ... and VS2015 barfed about the B(int) not properly initialising all base classes, even though it is via a delegation to the defaulted constructor.
Probably a duplicate of DevDiv#1184689 "constexpr delegating constructors". STL
Stephan T. Lavavej writes:
[Niall Douglas]
B() = default; constexpr B(int) : B() { } ... and VS2015 barfed about the B(int) not properly initialising all base classes, even though it is via a delegation to the defaulted constructor.
Probably a duplicate of DevDiv#1184689 "constexpr delegating constructors".
STL
Also https://connect.microsoft.com/VisualStudio/feedback/details/1579279/ for something publically trackable. Regards,
Hi Yuriy
Today I am on vacations. In two weeks, when returned home. I will send you
all the information, the files and the results obtained.
It will be a pleasure collaborate with your work
Francisco
El 24/07/2015 03:53, "Adam Merz"
Stephan T. Lavavej writes:
[Niall Douglas]
B() = default; constexpr B(int) : B() { } ... and VS2015 barfed about the B(int) not properly initialising all base classes, even though it is via a delegation to the defaulted constructor.
Probably a duplicate of DevDiv#1184689 "constexpr delegating
constructors".
STL
Also https://connect.microsoft.com/VisualStudio/feedback/details/1579279/ for something publically trackable.
Regards,
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (15)
-
Adam Merz
-
Andrey Semashev
-
Beman Dawes
-
charleyb123 .
-
Chris Glover
-
Francisco José Tapia
-
Glen Fernandes
-
glenfe
-
John Maddock
-
Klaim - Joël Lamotte
-
Marcel Raad
-
Niall Douglas
-
Oleg Grunin
-
Peter Dimov
-
Stephan T. Lavavej