Anteru's blog
  • Consulting
  • Research
    • Assisted environment probe placement
    • Assisted texture assignment
    • Edge-Friend: Fast and Deterministic Catmull-Clark Subdivision Surfaces
    • Error Metrics for Smart Image Refinement
    • High-Quality Shadows for Streaming Terrain Rendering
    • Hybrid Sample-based Surface Rendering
    • Interactive rendering of Giga-Particle Fluid Simulations
    • Quantitative Analysis of Voxel Raytracing Acceleration Structures
    • Real-time Hybrid Hair Rendering
    • Real-Time Procedural Generation with GPU Work Graphs
    • Scalable rendering for very large meshes
    • Spatiotemporal Variance-Guided Filtering for Motion Blur
    • Subpixel Reconstruction Antialiasing
    • Tiled light trees
    • Towards Practical Meshlet Compression
  • About
  • Archive

Visual Studio 2005 SP1

December 16, 2006
  • Programming
approximately 3 minutes to read

Yesterday, Microsoft released the Visual Studio 2005 SP 1. Unfortunately, it seems a rather serious bug has crept in - read on for details, especially if you are an active Qt user.First of all, there is no real changelog yet which describes all fixes, just a short release notes document. No idea when the full changelog will come online - for a company like Microsoft, it should be possible to release the changelog along with the service pack. In the release notes, take a look at “Recent versions of the Qt library source give errors on compilation.” Seems they have introduced a bug into the compiler, and provided the wrong workaround for it, too … The affected code - which compiles fine with the previous version and with GCC 4.1.2 (prerelease) is:

template <class T> class A
{
    public:
        typedef int N_A;
};

template <class T> class B : public A<T>
{
    public: typename A<T>::N_A test();
};

template <class T> typename A<T>::N_A B<T>::test() /* 1 */
{
    return 0;
}

I can confirm that it does not work with Visual Studio 2005 SP1. The suggested workaround for this perfectly valid code is to introduce a typedef for A<T>::N_A. However, this workaround is flawed. Instead of doing a typedef you can rely on inheritance. After all, B is derived from A and inherits the typedef just as well, so instead of typedef’ing you can write:

template typename B::N_A B::test() /* 1 */
{
    return 0;
}

No idea why Microsoft is introducing the additional typedef which does nothing new. My fix works with the new compiler and is less intrusive than the typedef’ing suggested by Microsoft (moreover, you don’t have to sync both typedefs!). Unfortunately, it seems that Qt will be affected by this bug. As Qt is used quite widely, I cannot understand how this bug may have slipped through the QA and become a known issue as it is likely to break a lot of code written against Qt. As long as there is no clear changelog and/or hotfix for this issue, I don’t recommend updating to SP1. I’m also rather curious to see what Trolltech will say about this issue.

Previous post
Next post

Recent posts

  • Data formats: Why CSV and JSON aren't the best
    Posted on 2024-12-29
  • Replacing cron with systemd-timers
    Posted on 2024-04-21
  • Open Source Maintenance
    Posted on 2024-04-02
  • Angular, Caddy, Gunicorn and Django
    Posted on 2023-10-21
  • Effective meetings
    Posted on 2022-09-12
  • Older posts

Find me on the web

  • GitHub
  • GPU database
  • Projects

Follow me

Anteru NIV_Anteru
Contents © 2005-2025
Anteru
Imprint/Impressum
Privacy policy/Datenschutz
Made with Liara
Last updated February 03, 2019