FAQ Database Discussion Community


Why do MSVC optimizations break SSE code when function arguments are const refs to temporaries or temporaries copied by value?

c++,c++11,visual-c++,sse,msvc12
Ran into this yesterday, I will try to give clear and simple examples which fail for me with MSVC12 (VS2013, 120) and MSVC14 (VS2015, 140). Everything is implicitly /arch:SSE+ with x64. I will trivialize the issue to a simple matrix transpose example using defined macros _MM_TRANSPOSE4_PS for illustration purposes. This...

Static Class Template member initialization

templates,c++11,visual-c++,static,msvc12
I have an issue when trying to initialize static members of a static class template. Basically, what I thought this approach would be useful for: I have a lot of objects, which are of course all of the same Base type but they have differing object types. I just want...

Custom Build Rule fails after converting to VS2013

visual-studio-2013,msvc12,build-rules
I need to integrate a legacy VS2008 project into my VS2013 solution. This project uses some custom build rules which initially worked after converting the .vcproj to a .vcxproj. However, when doing a fresh checkout of the project including the .vcxproj, the project file can no longer be opened. I've...

qualified names in C++ class declaration

c++,visual-c++,struct,msvc12
According to this page, the class name can be "optionally qualified". Thus, I expect the following code to compile: struct ::globalSt {}; In MSVC 2013u4, I get an error: Error 1 error C2039: 'globalSt' : is not a member of '`global namespace'' Am I misinterpreting the reference or is that...

Ambiguous inheritance of function when multiple inheritance of classes that themselves have diamond inheritance in their hierarchy

c++,inheritance,multiple-inheritance,virtual-inheritance,msvc12
Word description (code below): I have a library that provides a collection of classes. For each group of class we have two concrete types, (ClassA_Partial, ClassA), (ClassB_Partial, ClassB) etc. Each of these implements (Interface_Partial, Interface) respectively. Additionally, Interface is a Interface_Partial and each Class? is a Class?_Partial - creating a...

Building libtorrent with openssl with BJam

c++,bjam,libtorrent,msvc12
I am trying to build libtorrent (http://www.libtorrent.org/) using the provided jamfile. If I try to build it in its vanilla state everything goes well. I am then building using this command: bjam msvc-12.0 boost=source However I want to build it with OpenSSL which there seem to be support for. This...

MSVC 12 std::initializer_list bug when copying std::string

c++11,visual-studio-2013,language-lawyer,msvc12
I'm trying to create a C++ program with MSVC 12 (Visual Studio 2013, Update 4) which uses a std::initializer_list of structs which have std::string members. I seem to have run into a bug in MSVC. Here's a minimal example which exhibits the problem: #include <cassert> #include <initializer_list> #include <string> namespace...