Visual Studio “14” CTP

Visual Studio “14” CTP

Rate This
  • Comments 47

Today, the Visual Studio "14" CTP was released. Soma writes all about it on his blog. Go ahead and click over to read the article, especially the section on Visual C++ conformance updates with an updated conformance roadmap.

Pause.

Cool, huh?

Here are the improvements for Visual C++:

  • Generalized lambda capture: You can assign the result of evaluating an expression to a variable in the capture clause of a lambda. This allows an instance of a move-only type to be captured by value.
  • User-defined literals in the language and standard library: You can append numeric and string literals with meaningful suffixes to give them suitable semantics. The compiler transforms these suffixes into calls to appropriate UDL-operator functions. The <chrono>, <string>, and <complex> headers now provide literal operators for convenience. For example, "1729ms" means std::chrono::milliseconds(1729), "meow"s means std::string("meow"), and 3.14i means std::complex<double>(0.0, 3.14).
  • Completed noexcept: You can check whether an expression will throw an exception by using the noexcept operator. For example, noexcept(func()) will return "true" if func was specified as noexcept.
  • Inline namespaces: You can specify a nested namespace as "inline" to make its contents accessed from its parent namespace.
  • Thread-safe "magic" statics: Static local variables are initialized in a thread-safe way, removing the need for manual synchronization. Be aware that usage of these variables other than initialization is still not protected. Thread safety can be disabled by using /Zc:threadSafeInit- to avoid a dependency on the CRT.
  • Unrestricted unions: You can define unions that contain types with non-trivial constructors. Constructors for such unions have to be manually defined.
  • Includes November 2013 compiler CTP features: All new C++ 11 and C++ 14 language features that are released in the November 2013 compiler CTP for Visual Studio 2013 are also included in this preview. Go here for all the details.
  • Null forward iterators: The Standard Library's forward iterators (and stronger) now guarantee that value-initialized iterators compare as equal. This makes it possible to pass an empty range without a parent container. Be aware that generally, value-initialized iterators still cannot be compared to iterators from a parent container.
  • quoted(): These manipulators let iostreams preserve strings that contain spaces.
  • Heterogeneous associative lookup: When it is Enabled by special comparators (such as the less<> and greater<> transparent operator functors), the ordered associative containers gain templated lookup functions. This lets them work with objects that are comparable to keys, without actually constructing keys.
  • integer_sequence: Compile-time integer sequences are now supported to make template metaprogramming easier.
  • exchange(): This small utility function makes it convenient to assign a new value to an object and retrieve the old value.
  • get<T>(): This lets a tuple element be accessed by its type (when unique) instead of by its index.
  • Dual-range equal(), is_permutation(), mismatch(): C++98's "range-and-a-half" algorithms that are taking (first1, last1, first2) are difficult to use correctly. While they are still provided, C++14 has added overloads taking (first1, last1, first2, last2) which are significantly easier and safer to use.
  • tuple_element_t: This alias template is added for convenience and consistency with the type traits alias templates.
  • Filesystem "V3" Technical Specification (TS): The interface and implementation of <filesystem> are overhauled to follow this TS, which is likely to be incorporated into C++17.
  • Library Issues: 24 resolutions have been implemented (for example, is_final, make_reverse_iterator()), not including the resolutions that were already implemented in Visual C++ 2013. Notice that a library issue is a bug report for the Standard. It can be resolved by fixing a specification problem or even adding a small feature.
  • <chrono> fixes: The clocks are rewritten to be conformant and precise.
  • Minimal allocator fixes: Several library components (including basic_string and std::function) did not work with user-defined allocators implementing C++11's minimal allocator interface, instead requiring C++03's verbose allocator interface. All occurrences of this problem are fixed.
  • C99 library features: Most of the remaining C99 library features are implemented. snprintf is implemented, the printf and scanf families of functions now support the new C99 format string improvements, the strtod and scanf families of functions now support hexadecimal floating-point and library conformance is better improved by software updates and adjustments.
  • __restrict: The __restrict keyword is now supported on reference types in addition to pointer types.
  • Improved diagnostics: The compiler will now emit warnings about suspicious code that previously would not have resulted in warnings. For example, shadowed variables will now cause warnings. Warnings have also been made clearer.
  • The /Wv flag: You can use /Wv:XX.YY.ZZZZ to disable warnings that are introduced after compiler version XX.YY.ZZZZ. Notice that the emitted warnings may still differ from those emitted by the specified version.
  • Compiler software updates: We have fixed more than 400 bugs in the compiler. 179 of these were submitted by users through Microsoft Connect.
  • 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.
  • stdio performance: Many performance improvements are made in the stdio library, notably in the sprintf and sscanf families of functions.
  • Object file size reductions: Working together with compiler fixes, the STL's headers are changed to significantly reduce the sizes of object files and static libraries (that is after compilation but before linking. The sizes of linked EXEs/DLLs are unaffected). For example, when you compile a source file that includes all C and C++ Standard Library headers and does nothing else with them, for x86 with /MD /O2, Visual C++ 2013 generated a 731 KB object file. This is improved to be less than 1 KB.
  • Debug checking fixes: The STL's debug checks rejected null pointers that are passed as iterators, even when the Standard guaranteed that they should work (for example, merging two [null, null) ranges to a null output). Every algorithm is inspected and fixed.
  • Create declaration or definition: You can quickly create a function's declaration or definition in relation to its neighbors. To do this, right-click the declaration or definition, or use SmartTags.
  • Debugger visualizers: Natvis debugger visualization files can be added to a Visual C++ project for easy management and source control integration. Natvis files that are added to a project will take evaluation precedence over visualizers outside the project.
  • Native memory diagnostics:    
    • You can start a memory diagnostic session (Alt+F2) that monitors the live memory usage of your native application. This supports Windows Desktop.
    • You can capture heap snapshots of the running process in memory to see the types and instances for native allocations.
    • You can view the difference in memory allocations between two memory snapshots.
    • You can dive into the memory contents of a process snapshot by using the debugger for deeper analysis of the heap.

To view the entire release notes, known issues, and installation requirements go here.

Known issues include:

  • Expression evaluation fails during native memory diagnostics when the Just My Code setting is turned on. Turning off this setting will allow expression evaluation to work correctly.
  • New Visual C++ language features in this release do not have full IntelliSense support in the Visual Studio editor.
  • The noexcept operator may fail in scenarios that are involving complex templates.
  • Currently, user-defined literals may generate incorrect code under /CLR. Extremely large literals are not yet supported.
  • Code Analysis is not supported in this release of the compiler. If you try to build by using /analyze, the compiler will issue a warning and ignore the flag.
  • Building Windows Phone 8.1 apps by using Visual C++ is not yet supported.
  • Windows Store 8.1 applications that are written in Visual C++ built by using this preview compiler would not be validated by the Windows App Certification Kit, and these applications would rely on the Desktop DLLs instead of the "_app" versions of the DLLs which are used exclusively by Store applications. This will be rectified in future releases.

Remember that this is a CTP and is not meant for production environments.

We are proud of this CTP and want to thank you for your ongoing feedback, positive and not so positive. Look for new articles about CTP features this week and most of next week from folks on the Visual C++ team.

Please try the Visual Studio "14" CTP and give us your feedback. Report bugs using Connect and share your suggestions through Send-a-Smile from within the IDE or on our UserVoice site. You can also leave your comments below.

Thank you.

Thanks for sharing your comment! If your comment doesn't appear right away, please be patient as it may take a few minutes to publish or may require moderation.
  • "Native memory diagnostics"

    ...

    O_O

  • Thanks for the update, good to see the progress!

    Particularly happy about the `<chrono>` fixes (finally portable time measurement!), Nov. 2013 CTP features, Filesystem, C99 (question: why `__restrict` instead of the standard `restrict`?), C++14 type-based `std::get` (for `std::tuple`), and compiler bug-fixes (assuming that includes alias templates bugs, STL will know what I'm referring to :]) :-)

    BTW, November 2013 compiler CTP had "constexpr (except for member functions)" -- have there been any further improvements here (in particular with regard to C++14 relaxed constexpr restrictions)?

    Any ETA on `thread_local` (I've ran into the issue of non-std extension ` __declspec(thread)` only supporting built-ins :-/), expression SFINAE, and C++14 variable templates? :-)

  • Congrats on the rapid progress towards C++14 conformance!

    I'm a bit concerned about the priority of the "expression SFINAE" feature. It is my impression that "duck typing" using SFINAE-based type trait checks is becoming increasingly common in C++14 code. It would be really unfortunate if libraries that use this feature would remain unusable with MSVC for years to come. (Relaxed constexprs and template variables are both nice features, but since GCC doesn't yet support them either, these are not as important as expression SFINAE conformance.)

  • MattPD> assuming that includes alias templates bugs, STL will know what I'm referring to

    Yes - when we implemented integer_sequence and its alias template helpers at the beginning of Dev14's development cycle, we switched over tuple and the rest of the STL to use it (replacing internal machinery that predated alias templates), and encountered a bunch of compiler bugs along the way. All of those bugs have been fixed.

    > have there been any further improvements here (in particular with regard to C++14 relaxed constexpr restrictions)?

    I am not as familiar with this area (as we haven't attempted to use constexpr in the STL yet), but according to my understanding: there have been several constexpr bugfixes since the Nov 2013 CTP, but member functions are still not yet supported, and C++14's magical constexpr powers are definitely not yet supported.

    Stephan> I'm a bit concerned about the priority of the "expression SFINAE" feature.

    The compiler team is aware that the STL needs this too (for several C++14 features and Library Issue resolutions), but it is difficult to implement in their current codebase.

  • 'Thread-safe "magic" statics'

    Is this a precursor to the eventual implementation of C++ 11's thread_local?

  • Good work on the CTP's. Any hints on when we can expect an RTM's? I'm still itching to get to use any of the "November 2013 compiler CTP" features in production code. Thanks

  • @petke: they're looking to release it sometime in 2015, so we'll have to wait a bit longer.

  • Stick: They are basically unrelated, except that magic statics internally uses our (non-Standard) thread-local storage machinery.

    petke: Our policy is that we don't talk about release dates before they're publicly announced - but Soma (our Corp VP) announced in the linked post: "Visual Studio "14" will most likely be available sometime in 2015, with a more complete preview release and final naming available later this year."

  • Awesome! So many things I've wanted/been nagging about :)

  • struct A

    {

    int a[3] = {0,1,2}; // fatal error C1001: An internal error has occurred in the compiler.

    };

  • Wow, that sounds really great! Unfortunately I cannot test it if I cannot install it side-by-side with Visual Studio 2013. I hope this will be fixed in the next CTP.

  • Any performance improvements?

    Auto Vectorization / Loop Unrolling / etc?

    What about building a library with support for Linear Algebra?

  • I hope C11 is not going to take 15 years too.

  • @ Stephan

    "I am not as familiar with this area (as we haven't attempted to use constexpr in the STL yet), but according to my understanding: there have been several constexpr bugfixes since the Nov 2013 CTP, but member functions are still not yet supported, and C++14's magical constexpr powers are definitely not yet supported."

    This is a big disappointment for me, I'm sure I'm not alone in requiring these features. Please can you assign some resources.

  • What should I do to start "Native memory diagnostics" on  "Hello World" Win32 Console Application?

Page 1 of 4 (47 items) 1234