Category Archive for Microsoft

Visual C++ 2015 – Speeding up the Incremental Developer Build Scenario

Ankit Asthana published an interesting blog post on the Visual C++ Team Blog about Speeding up the Incremental Developer Build Scenario.
The developer incremental scenario is one where a developer changes a single or multiple source files (while fixing bugs) and builds. This scenario for Visual C++ is roughly equivalent to the amount of time spent in linking the executable (.dll or .exe).
The blog post discusses the following new features:

  • Incremental Linking for Static Libraries (/incremental linker switch)
  • /Zc:inline and Algorithmic improvements (/Zc:inline compiler switch, 2X Faster Links)
  • Fast Program Database (PDB) generation (/debug:FASTLINK linker switch, 2X Faster Links)
  • Incremental Link Time Code Generation (iLTCG) (/LTCG:incremental linker switch, 4x faster links)

It’s definitely worth reading his post, it includes some impressive benchmarks :)

Share

Visual C++ 2015 – Resumable Functions

Visual C++ 2015 includes a general purpose solution to implement resumable functions based on the concept of coroutines. A coroutine is a generalized routine entity which supports operations like suspend and resume in addition to the traditional invoke and return operations.
These resumable functions are being proposed for inclusion in ISO C++17.
For the VC++ 2015 Preview, the feature only works for 64-bit targets, and requires adding the /await switch to your compiler command-line.
Such resumable functions have several use cases:

  • Asynchronous operations
  • Generator pattern
  • Reactive Streams

Here is a simple example demonstrating an asynchronous operation:

#include <future>

using namespace std; 
using namespace std::chrono; 
  
// this could be some long running computation or I/O
future<int> calculate_the_answer() 
{ 
    return async([] { 
        this_thread::sleep_for(1s); return 42; 
    }); 
} 
  
// Here is a resumable function
future<void> coro() { 
    printf("Started waiting... \n"); 
    auto result = __await calculate_the_answer(); 
    printf("got %d. \n", result); 
} 
  
int _tmain(int argc, _TCHAR* argv[]) 
{ 
    coro().get(); 
}

The important line here is line 17. The function calculate_the_answer() is an asynchronous function which immediately returns by returning a future. Thanks to the __await keyword on line 17, the rest of the coro() function can be implemented as if you are simply programming synchronously! No need anymore to mess around with task continuations or what not. This makes asynchronous programming much easier :D

Read the full explanation here.

Share

Visual Studio 2015 Preview

Microsoft has released a preview of Visual Studio 2015.
There are a lot of C++ changes included in this preview. You can read the full release notes here.

Here is a short version quoted from a blog post from Eric Battalio from Microsoft:

  • C++ Cross-Platform Mobile Development. C++ is attractive because it offers portability and a chance to reuse the same code on different platforms. With Visual Studio 2015 Preview, modern application developers can use the Visual C++ tool chain (c1xx, c2) to target Microsoft Windows Platforms and Clang / LLVM for targeting Android (with plans to support iOS in the near future). This makes it even easier to re-use existing C++ libraries to target multiple platforms (Android/Windows/iOS), share cross-platform code, and create high-quality Xamarin Native Android and Native-Activity applications using all of the power of Visual Studio. For a closer look, see Cross-Platform Mobile Development with Visual C++.
  • C++11, C++14, C++17 (proposed) compatibility. Standards support across compilers improves portability. With Visual Studio 2015 Preview, Visual C++ is even more compliant with user-defined literals (C++11), generic lambdas (C++14), and await (C++17 proposed). For a view of VS conformance in table form, see this post by Stephan Lavavej (STL). Also check out Details About Some of the New C++ Language Features, Improvements to Warnings in the C++ Compiler, and Resumable Functions in C++.
  • Enhanced productivity & build-time improvements. “Productivity” and “C++” are not often used in the same sentence except to criticize some aspect of the IDE, build process or diagnostics. Friction in any of these areas slows down the development process. With Visual Studio 2015 Preview, you get improvements in each including refactoring for C++ and improved IntelliSense database buildup and simplified QuickInfo for template deduction (IDE); incremental linking for static libs, new fast PDB generation techniques, multithreading in the linker (build); and dedicated space for analyzing graphics space using the Visual Studio Graphics Analyzer (VSGA) and you can view the impact of shader code changes without re-running the app (diagnostics). For more details about incremental build, see Speeding up the Incremental Build Scenario.
  • Improved performance. Most of the C++ developers we spoke with needed code to run fast, often as part of intensive data transformation or analysis or real-time control. Visual Studio 2015 Preview builds on the AVX2 support in Visual Studio 2013 to bring more general optimizations like loop-if unswitching, Vectorization of control flow, and increased support for Vectorization (including when optimizing in favor of smaller code). In addition we have a number of ARM32 compiler code generation improvements.

 
See Eric’s blog post here for a couple more links.
Download the Visual Studio 2015 Preview.

Share

Visual Studio Community 2013

Microsoft announced the availability of Visual Studio Community 2013.
This Community edition replaces the Express editions.
You no longer have to decide which Express edition to use because the Community edition supports all kinds of development, web, mobile, desktop, …
Visual Studio Community 2013 includes all the functionality of Visual Studio Professional 2013.
Unlike the Express editions, the Community edition supports extensions.

Of course there are some restrictions on who can use this edition, but not many:

Here’s how individual developers can use Visual Studio Community:

  • Any individual developer can use Visual Studio Community to create their own free or paid apps.

Here’s how Visual Studio Community can be used in organizations:

  • An unlimited number of users within an organization can use Visual Studio Community for the following scenarios: in a classroom learning environment, for academic research, or for contributing to open source projects.
  • For all other usage scenarios: In non-enterprise organizations, up to 5 users can use Visual Studio Community. In enterprise organizations (meaning those with >250 PCs or > $1MM in annual revenue), no use is permitted beyond the open source, academic research, and classroom learning environment scenarios described above.

Download and get more information from here.

Share

C++14 STL Features, Fixes, And Breaking Changes In Visual Studio 14 CTP1

Stephan T. Lavavej, aka STL, has written a very detailed blog post describing new C++14 STL features, implemented fixes, and breaking changes in Visual Studio 14 CTP1. Read it here.

One notable breaking change is that containers cannot have const elements:

The Standard has always forbidden containers of const elements (e.g. vector, set). (C++98/03’s prohibition was crystal clear: elements must be Assignable, which const T isn’t. C++11/14’s prohibition is obscurely hidden, but it’s there.) Previously, VC accepted such containers due to non-Standard machinery in std::allocator. We’ve removed that machinery, so such containers now fail to compile.

Share

Visual Studio “14” CTP

Microsoft has released Visual Studio “14” CTP. You can read the announcement on Soma’s blog. Visual Studio “14” will most likely be available sometime in 2015.

Note: This is a CTP release, thus it should be installed in a test environment, such as a VM or a clean machine. Do not install on a machine with another version of Visual Studio installed.

Specifically for C++, there are quite a few improvements, such as:

  • Generalized lambda capture
  • User-defined literals in the language and standard library
  • Completed noexcept
  • Inline namespaces
  • Thread-safe “magic” statics
  • Unrestricted unions
  • All November 2013 compiler CTP features
  • Null forward iterators
  • quoted()
  • Heterogeneous associative lookup
  • integer_sequence
  • exchange()
  • get()
  • Dual-range equal(), is_permutation(), mismatch()
  • tuple_element_t
  • Filesystem “V3″ Technical Specification (TS)
  • Object file size reductions
  • Debug checking fixes
  • Create declaration or definition
  • Native memory diagnostics
  • Refactored C Runtime (CRT): This CTP contains the first preview of the substantially refactored CRT. msvcr140.dll no longer exists. It is replaced by a trio of DLLs: vcruntime140.dll, appcrt140.dll, and desktopcrt140.dll.

Read Eric’s blog for a bit more details on those improvements.

Download the CTP.

Share

Microsoft MVP VC++ 2014 Award

Today I got a mail from Microsoft saying that my MVP (Most Valuable Professional) award for Visual C++ is extended for 2014 :)

Congratulations! We are pleased to present you with the 2014 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Visual C++ technical communities during the past year.

See my MVP profile.

Share

My BeCPP Presentation “What’s new in Visual C++ 2013″

On Monday March 17th, 2014 I gave a “What’s new in Visual C++ 2013″ presentation for the Belgian C++ Users Group (BeC++).
This time there were around 55 attendees for the BeC++ meeting, quite a success :)
The slides of my presentation can be downloaded below:

Peter Van Weert gave a presentation “What’s new in C++14″.
His slides can be downloaded from the official BeC++ blog.

There are also a couple of pictures from the event on the BeC++ blog.

And I already started planning the next Belgian C++ Users Group meeting. It will be on May 8th, 2014. Details will follow soon.

Share

C++ AMP Presentation for KLA Tencor / ICOS

Today I gave an introduction presentation on C++ AMP for software engineers and team leads of KLA Tencor / ICOS. The presentation was almost the same as I gave on Meeting C++ in November 2013.
The slides can be downloaded below:

Share

Visual Studio 2013 Update 1

Visual Studio 2013 Update 1 has been released.

The following are Visual C++ related bug fixes:

  • Assume that you edit a dialog that contains at least one picture control in Resource Editor. After you save the file, the project can no longer be compiled.
  • When you edit multiple resources in Resource Editor, Visual Studio crashes randomly.
  • Addresses some Visual C++ automatic formatting issues.
  • Visual C++ IDE does not work as expected if there is an unexpected registry subkey under the following registry key:
    HKCU\Software\Microsoft\VisualSTudio\12.0\FileExtensionMapping
  • When you try to link with PGO on amd64_x86 complier, Visual Studio crashes.

Update 1 is a rather small update. A list of all the fixes can be found here.

Download the update from here.

S. Somasegar said that they are well underway on Visual Studio 2013 Update 2, their first major feature update for VS2013, which they are looking forward to delivering this spring.

Share

MVP Global Summit 2013 November Report

I gave a report of the November MVP Global Summit 2013 to software engineers in my company. Obviously, I’m only talking about things that did not fall under NDA.
The slides can be downloaded below:

Share

Announcing the Visual C++ Compiler November 2013 CTP

Visual Studio 2013 has only been released very recently, and the Visual C++ team already has a new CTP out with new features :)
The following table gives an overview and even includes features that are planned for future releases.

  • Implicit move special member function generation (thus also completing =default)
  • Reference qualifiers on member functions (a.k.a. “& and && for *this”)
  • Thread-safe function local static initialization (a.k.a. “magic statics”)
  • Inheriting constructors
  • alignof/alignas
  • __func__
  • Extended sizeof
  • constexpr (except for constructors)
  • noexcept (unconditional)
  • C++14 decltype(auto)
  • C++14 auto function return type deduction
  • C++14 generic lambdas (with explicit lambda capture list)
  • (Proposed for C++17) Resumable functions and await

Remember, this is a CTP so it does not come with a Go Live license.
More details can be found on the VCBlog.

Share

Meeting C++ 2013 – “Introduction to Microsoft C++ AMP”

The 2013 edition of Meeting C++ was once again a great conference.
This year I gave an introduction to Microsoft C++ AMP on the conference.
The session was a great success. I estimate there were around 100 people in the room, and lots of interesting questions :)
After the session I read on Twitter

Awesome presentation on C++ AMP in track B. #meetingcpp

C++ AMP makes it possible to write C++ for GPUs in a STLesque fashion. #meetingcpp

Below you can download the slides of my presentation.

Share

MVP Global Summit November 2013

Looking forward to the Microsoft MVP Global Summit November 2013 :)
MVP Global Summit November 2013

Share

Visual Studio 2013 Available for Download

The final versions of Visual Studio 2013, Team Foundation Server 2013 and .NET 4.51 are now available from MSDN. You can also download trials.

VS 2013 can be installed side by side with previous versions of Visual Studio or, if you have a VS 2013 pre-release, it can be installed straight on top of the pre-release. TFS 2013 cannot be installed side by side but can also be installed on top of either a previous version (TFS 2012 or TFS 2010) or a pre-release.

Learn more about what’s new in Visual Studio 2013.

What’s new in Visual C++ 2013 (excerpt from MSDN):

  • Compiler
    • Added support for the following ISO C++11 language features:
      • Default template arguments for function templates.
      • Delegating constructors.
      • Explicit conversion operators.
      • Initializer lists and uniform initialization.
      • Raw string literals.
      • Variadic templates.
      • Alias templates.
      • Deleted functions.
      • Non-static data member initializers (NSDMIs).
      • Defaulted functions.  (using =default to request memberwise move constructors and move assignment operators is not supported)
    • Added support for the following ISO C99 language features:
      • _Bool
      • Compound literals.
      • Designated initializers.
      • Mixing declarations with code.
    • String literal conversion to modifiable values can be disallowed by using the new compiler option /Zc:strictStrings. In C++98, conversion from string literals to char * (and wide string literals to wchar_t *) was deprecated. In C++11, the conversion was removed entirely. Although the compiler could strictly conform to the standard, instead it provides the /Zc:strictStrings option so that you can control conversion. By default, the option is off. Note that when you are using this option in debug mode, the STL will not compile.
    • rvalue/lvalue Reference Casts. With rvalue references, C++11 can clearly distinguish between lvalues and rvalues. Previously, the Visual C++ compiler did not provide this in specific casting scenarios. A new compiler option, /Zc:rvalueCast, has been added to make the compiler conformant with the C++ Language Working Paper(see section 5.4, [expr.cast]/1). The default behavior when this option is not specified is the same as in Visual Studio 2012.
  • STL
    • Support for the C++11 explicit conversion operators, initializer lists, scoped enums, and variadic templates.
    • All containers now support the C++11 fine-grained element requirements.
    • Support for these C++14 features:
      • “Transparent operator functors” less<>, greater<>, plus<>, multiplies<>, and so on.
      • make_unique<T>(args…) and make_unique<T[]>(n)
      • cbegin()/cend(), rbegin()/rend(), and crbegin()/crend() non-member functions.
    • <atomic> received numerous performance enhancements.
    • <type_traits> received major stabilization and code fixes.

This list is just a small part of everything that’s new. There are also

  • Visual C++ library enhancements
  • C++ application performance enhancements
  • Diagnostics enhancements
  • 3D graphics enhancements
  • Quite a few very nice IDE and Productivity enhancements.

Read all the details here.

Visual C++ 2013 now also supports “just my code” debugging which makes working with C++ even better. The ability to filter the call stack down to just the code you wrote when debugging has long existed for managed languages and is now available for C++ :)

Share

Visual Studio 2013 UI Changes

The Visual Studio 2013 Preview has a number of UI improvements compared to 2012.
There is again a bit more color in the IDE, and borders between controls and windows are more visible.
Below is an example of the Solution Explorer

Read this blog post on the Visual Studio team blog for more details.

Share

Join the Belgian Windows 8 apps race

And win prices :)

Share

Microsoft MVP VC++ 2013 Award

I got the confirmation email from Microsoft that my MVP (Most Valuable Professional) award for Visual C++ is extended for 2013 :)
I’m already looking forward to the next Summit :)

Congratulations! We are pleased to present you with the 2013 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Visual C++ technical communities during the past year.

See my MVP profile.

Share

Visual Studio 2012 Update 2 Now Available

Microsoft has released Update 2 for Visual Studio 2012 (VS2012.2). You can get it here.

Just as with VS2012.1 (which is installed as part of VS2012.2 for those of you who don’t already have VS2012.1 installed), this release contains important fixes as well as a wealth of new functionality, addressing feedback we’ve received from the community and aligning with key software development trends in the market. The new functionality primarily spans (though is not limited to) five areas of investment: agile planning, quality enablement, Windows Store development, line-of-business development, and the general developer experience.

Check out Somasegar’s blog post for more details on this update.

Share

MVP Global Summit 2013 February Report

On March 25th, I gave a report of the February MVP Global Summit 2013 to software engineers in my company. Obviously, I’m only talking about things that did not fall under NDA.
The slides can be downloaded below:

Share