Visual Studio 2010 refuses to pass union templates as template template parameters.The following code fails to compiletemplate<template<class> class S>struct test{};template<class T>union foo{};int main(){ test<foo> t;}The error message is the following:error C3200: 'foo' : invalid template argument for template parameter 'S', expected a class templateChanging foo to be a structure makes it work as expected.Unions are classes, and this should work. It does work with other compilers like GCC or Clang.This bug seriously impedes the usage of unions in code that makes use of meta-programming.Unions can be necessary in the low-level details of high-performance code, a field where meta-programming techniques are quite popular.
Visual Studio/Team Foundation Server/.NET Framework Tooling version
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results
Please wait...