Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

VC++ Bytes 2-2: New Front-End Compiler Features with Karl Niu

Download

Right click “Save as…”

Fellow C++ PM Karl Niu provides an impressive series of demos showcasing new compiler features in Visual Studio "14".

Use the following guide to quickly access the features you'd like to review:
[01:20] Thread safe statics
[04:05] Inline namespaces
[07:59] noexcept
[10:02] Unrestricted unions
[11:48] User-defined literals (UDLs)
[13:04] Generalized lambda capture 

Visit this page to download your own (free) copy of Visual Studio "14" containing all these features and more!

Tags:

Follow the Discussion

  • felix9felix9 the cat that walked by itself

    all of them are super useful ! especially thread safe static init and noexcept !

  • @Karl: Thanks for the informative survey. (I just wish the fonts were larger.. or maybe I'm just getting old)

    Pardon me for hijacking this to a different topic, but I have no other way to reach you and I suspect Connect doesn't mail you on follow-ups:  Would you kindly take a second look at this bug?  I might have failed to explain the impact in the original report, so i've done so extensively here.

  • Ying ChiYing Chi

    Dear @Karl, I seek technical support for Visual Studio C++ debug.

    I am using Visual Studio C++ to program, and felt the debugging is really difficult. For example, to check the values in a large 3D matrix, it takes me long time to unfold rows or columns one by one…
    Is there any methods or assisting tools can help us make the VC++ debug very easy, very beautiful, like using Matlab. That really can make life happier.

    Some friend said .Net can help, but didn't tell me how;
    Some said Matlab has the capability of supporting, also did not tell me how;
    Some said other visual tools like array visualizer extension, and/or arraydebugviewer can be used, is this true? how to install and combine them?

    Appreciate much your great help in advance!

  • David LowndesDavid Lowndes

    For the unrestricted unions feature, the error C2280 (I think that was the number shown in the video), "attempting to reference a deleted function" - is far from self-explanatory. Why can't it say something more specific like "Union needs a constructor for non-trivial member constructor"?

  • Good stuff coming, thanks for the demo. A larger font size would help a lot in future videos.

    I agree with David L. -- a much better error message should be possible with the missing ctor.

  • @schroedl:Excellent point on the font size; I'll be sure to zoom into the editor for future videos!

    I'll get Karl to address the other comment =)

  • @David Lowndes:

    The standard mandates that we must use deleted functions (read this) to enforce the constructor definition requirement for unions with members that have non-trivial constructors. This is why the error message refers not to unions, but to an implicitly used language mechanism. We could  insert an additional message specific to the unrestricted union case to help novice users, but this would clutter the compiler's output for more advanced users, who can easily deduce why the constructor was deleted by looking at the definition of the union.

    @Ofek_Shilon: Sorry for taking a while. We will respond to you on Connect.

    @Ying Chi: I am not very familiar with the debugger myself and so cannot help you much on this subject. Have you tried contacting the debugger team directly via Send-a-Smile/Frown or Connect?

  • David LowndesDavid Lowndes

    @KarlNiu:
    One of the reasons that many developers think C++ is hard is often because the compiler error messages are awful. This is such an example. Do not assume we're all intimately familiar with the nitty gritty details of the C++ standardize - we're not. Please give us as much useful information to help us find our mistakes. Do you want a Connect bug/suggestion report on this?

  • David LowndesDavid Lowndes

    Add a vote to this if you think the error message shown in the demo for the unrestricted unions situation is pants.

    https://connect.microsoft.com/VisualStudio/feedback/details/917226/unrestricted-unions-error-c2280-attempting-to-reference-a-deleted-function-does-not-describe-the-problem-adequately-to-the-normal-developer

  • @Ying Chi: On behalf of the debugger team:

    "Unfortunately, Visual Studio does not provide a way to view the contents of a matrix better than what you get by expanding it in the watch window.  If you want to see the data in its rows and columns, your best option is to write a helper function which dumps the contents of the matrix into a global string buffer, using whatever pretty format you desire.  You can then call the helper function from the watch window and use the string viewer (click the magnifying glass to the right of the 'value' column) to view the global string that the helper function populates."

    Also, "the traditional way to do better native visualizations for collections for the debugger is the natvis file: 

    http://blogs.msdn.com/b/vcblog/archive/2013/06/28/using-visual-studio-2013-to-write-maintainable-native-visualizations-natvis.aspx"

  • @YingChi: for watching a fixed-size (say, 3 by 3) matrices, I use this trick:

    http://ofekshilon.com/2009/02/26/2d-matrix-watch-introducing-autoexpdat/

    The post is from the autoexp era, but it easily extends to natvis.

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.