msvc12

Why does is_copy_constructible return true for unique_ptr in MSVC12

I would have expected this static assertion to fire: #include <type_traits> #include <memory> int main() { static_assert(std::is_copy_constructible<std::unique_ptr<int>>::value, "UPtr has copy constructor?"); } But it does not. Compiled using MSVC12: Microsoft (R) C/C++ Optimizing Compiler Version...

“Function has no address” despite disabled optimization (/Od)

During debug in MSVC 2012, I am attempting to call some functions from the Watch window in order to dump data to files. However, I keep getting this error: Function Matrix::Save has no address, possibly due to compiler optimizations. The class Matrix is located in my own external library. A quick...

Can&#39;t assign string literal to boxed std::string vector

This is a simplified version of my type system: #include <string> #include <vector> template<typename T> class Box { public: Box(const T& value) : _value(value) {}; private: T _value; /* ... */ }; typedef Box<int> Int; typedef Box<double> Double; typedef Box<std::string> String; int main(int argc,...

Compiling gcc code in Visual Studio causes error C3646: &#39;__attribute__&#39;: unknown override specifier

I am getting the following error: error C3646: '__attribute__': unknown override specifier Code: LEMUR_PREALIGN char _stack[ sizeof(_Type) * _Count ] LEMUR_POSTALIGN; Complete error: 1>c:\program files\indri\indri 5.9\include\indri\greedy_vector(52): error C3646: '__attribute__': unknown override...

Possible compiler bug in MSVC12 (VS2013) with designated initializer

Using VS2013 Update 2, I've stumbled on some strange error message : // test.c int main(void) { struct foo { int i; float f; }; struct bar { unsigned u; struct foo foo; double d; }; struct foo some_foo = { .i = 1, .f = 2.0 }; struct bar some_bar = { .u = 3, // error C2440 : 'initializing' : cannot...

unresolved external symbol __mm256_setr_epi64x

I have written and debugged some AVX code with g++ and now I'm trying to get it to work with MSVC, but I keep getting error LNK2019: unresolved external symbol __mm256_setr_epi64x referenced in function "private: union __m256i __thiscall avx_matrix::avx_bit_mask(unsigned int)const " (?avx_bit_mask...