The following compiler features are new for Visual C++ 6.0.
The __assume keyword is a hint to the optimizer that says that the expression passed as the argument is true until the expression is killed. This keyword can be used in conjunction with assert() during debug builds to ensure that the expression used with __assume is always true. Specifying __assume for an expression enables the compiler to perform additional optimizations, the safety of which could not be determined without this hint from the programmer. For more information, see https://msdn.microsoft.com/en-us/library/aa235387(v=vs.60).aspx in the Visual C++ Programmer's Guide.
For better inline control, there are three new keywords: inline, __inline, and __forceinline. The inline and __inline keywords are hints to the compiler to try to inline the function; the optimizer decides whether inlining should be performed based upon optimization switches (optimizing for size vs. speed) and other heuristics. To provide better control over which functions are inlined, the __forceinline keyword is now supported. This keyword tells the compiler to go beyond the current inlining heuristics and to absolutely inline the function(s) to which it is applied, except in cases in which inlining would be impossible. For more information, see https://msdn.microsoft.com/en-us/library/aa299373(v=vs.60).aspx in the Visual C++ Programmer's Guide.
Exported makefiles now put the file dependencies in a separate, editable text file.
This feature provides more control over writing dependency information when you https://msdn.microsoft.com/en-us/library/aa233950(v=vs.60).aspx . You can set options for this feature in the following places:
- ExportMakefile(s) dialog box (Project menu, Export Makefile… command), Write dependencies when writing makefiles check box
- Project Settings dialog box (Project menu, Options command), Allow per-configuration dependencies check box
- Build tab of the Options dialog box (Tools menu, Options command), Always write dependencies when writing makefiles check box
New compiler warnings have been added to help catch common programming errors.
The compiler now supports the placement form of operator delete. Consequently, an exception, thrown during the initialization of an object, calls the proper delete function when the placement new is used.
For more information, see https://msdn.microsoft.com/en-us/library/aa298975(v=vs.60).aspx or https://msdn.microsoft.com/en-us/library/aa299400(v=vs.60).aspx in the Visual C++ Programmer's Guide, or https://msdn.microsoft.com/en-us/library/t48aek43(v=vs.60).aspx in the C++ Language Reference.
You can use #pragma warning (push, n) and #pragma warning (pop) to push the current warning state (enabled or disabled) onto a stack and pop it off again. n represents a https://msdn.microsoft.com/en-us/library/2c8f766e(v=vs.60).aspx level whose state is to be pushed. You can use this feature when writing headers to ensure that a programmer does not compile the header with a warning level higher than you intend.
The Visual C++ compiler can embed certain run-time checks in code to detect common errors. The enables these checks. Run-time checks can only be used in debug (/Od) builds. There are new checks for auto-initialization of local variables, function pointer call stack validation, and call stack validation.
Compile-time throughput in projects with large precompiled header files (.pch) is faster. Compiler throughput on debug projects is as much as 30% faster, and on non-debug projects, as much as 15% faster.