visual-c++-2012

std::async decaying(losing) rvalue reference in Visual Studio 2012 Update 2. Any workarounds?

陌路散爱 提交于 2019-12-23 08:40:02
问题 Consider the below code: #include <memory> #include <future> using namespace std; template <typename T, typename Work> void Test2(future<T> f, Work w) { async([](future<T> && f, Work w) {}, move(f), move(w)); } int main() { future<int> x = std::async([]()->int{ std::this_thread::sleep_for(std::chrono::microseconds(200)); return 10; }); Test2(std::move(x), [](int x){}); return 0; } The above, fails with the following compiler error: Error 1 error C2664: 'void Test2::::operator ()(std::future<

std::async decaying(losing) rvalue reference in Visual Studio 2012 Update 2. Any workarounds?

情到浓时终转凉″ 提交于 2019-12-23 08:39:17
问题 Consider the below code: #include <memory> #include <future> using namespace std; template <typename T, typename Work> void Test2(future<T> f, Work w) { async([](future<T> && f, Work w) {}, move(f), move(w)); } int main() { future<int> x = std::async([]()->int{ std::this_thread::sleep_for(std::chrono::microseconds(200)); return 10; }); Test2(std::move(x), [](int x){}); return 0; } The above, fails with the following compiler error: Error 1 error C2664: 'void Test2::::operator ()(std::future<

Azure start-up task hangs

↘锁芯ラ 提交于 2019-12-22 09:39:23
问题 I have an Azure project with an MVC4 role where I have added the Visual C++ 2012 Runtime Library setup file, and a script to silently install it. The script works and the library gets installed, the only problem is that the task never finishes and the installation process never exits, which then blocks the role from starting: I connected to the server using Remote Desktop, and by looking at the task manager I can see the process vcredist_x64.exe : (2 of them actually, but I think that's

std::function bound to member function

痞子三分冷 提交于 2019-12-22 04:43:15
问题 The following code doesn't compile in VS2012 class Zot { public: int A() { return 123; } }; int _tmain(int argc, _TCHAR* argv[]) { std::function<int (Zot*)> fn = &Zot::A; return 0; } However, changing the assignment to std::function<int (Zot*)> fn = std::bind(&Zot::A, std::placeholders::_1); Does work. There are a lot of online examples that show the original syntax. Did something change in the C++11 spec to disallow this syntax? Is there a valid shorter form for the assignment? Edit : the

C++11 filesystem (VS2012)

♀尐吖头ヾ 提交于 2019-12-19 14:44:33
问题 I am having a lot of trouble finding any documentation on the header included with vs2012. I see that it is mentioned here but they don't provide a link on how to use it. What I am really looking for is documentation for how to use it, with the visual studio implementation being preferred. Thanks 回答1: The <filesystem> header is not part of C++11; it is a proposal for C++ TR2 based on the Boost.Filesystem library. Visual C++ 2012 includes an implementation of the proposed library. See the MSDN

Where is the VC++ 2012 Runtime Bootstrapper package in Visual Studio 2013?

瘦欲@ 提交于 2019-12-19 08:14:44
问题 I have a .NET 4.5.2 application that's deployed via ClickOnce. It uses the Magick.NET library, which requires the Visual C++ Redistributable for Visual Studio 2012. I've tried it with the 2013 package, but it still needs the 2012 version to work. Unfortunately, the only version listed under the possible Prerequisites in Visual Studio 2013 is the 2013 version. Other version are nowhere to be found: How do I include the Visual C++ 2012 Runtime Libraries with my ClickOnce app in Visual Studio

Compile C app with Visual Studio 2012

落花浮王杯 提交于 2019-12-18 11:32:19
问题 I plan to write application in C using Microsoft Visual Studio 2012. The problem is that I can't find a way to compile it right in the editor. I found this solution http://msdn.microsoft.com/en-us/library/bb384838.aspx but I dont like it. Can you recommend me a way to compile C program right in the Visual Studio 2012? 回答1: It is a little bit tricky to compile plain C90 and C++x0 (only partially supported) projects in VS2010 (and probably Visual Studio 11, I haven't tried native development in

CreateWindow() in Visual C++ always return null

依然范特西╮ 提交于 2019-12-17 17:00:45
问题 Here is my code, in the WinMain entry point i registered a class and tried to create a window, but the CreateWindow() function always return NULL. However the RegisterClass() function did succeed. What have i done wrong? #include <Windows.h> #include <stdio.h> LRESULT CALLBACK event(HWND, UINT, WPARAM, LPARAM) { return 0; } int CALLBACK WinMain( _In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow ) { WNDCLASS wndClass; wndClass.hbrBackground =

Explicit Return Type of Lambda

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 08:45:07
问题 When I try and compile this code (VS2010) I am getting the following error: error C3499: a lambda that has been specified to have a void return type cannot return a value void DataFile::removeComments() { string::const_iterator start, end; boost::regex expression("^\\s?#"); boost::match_results<std::string::const_iterator> what; boost::match_flag_type flags = boost::match_default; // Look for lines that either start with a hash (#) // or have nothing but white-space preceeding the hash symbol

Cefsharp didn't start on Client Machine?

浪子不回头ぞ 提交于 2019-12-14 01:12:13
问题 What to add with .net 4.5.1, Visual C++ 2012 Redistribution inorder to make cefsharp work on Client machine?. I installed both .net 4.5.1, Visual C++ 2012 Redistribution package and the dlls libcef.dll icudt.dll CefSharp.dll CefSharp.WinForms.dll are all present, the cefsharp form didn't open up. Its showing exception "Could not load file or assembly cefsharp.dll". I have tried installing Visual C++ 2008,2010,2012 versions too. But it still didn't show up. 回答1: If you have this same problem