[Bug c++/35722] [C++0x] Variadic templates expansion into non-variadic class template

3dw4rd at verizon dot net gcc-bugzilla@gcc.gnu.org
Fri May 20 17:20:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35722

Ed Smith-Rowland <3dw4rd at verizon dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |3dw4rd at verizon dot net

--- Comment #13 from Ed Smith-Rowland <3dw4rd at verizon dot net> 2011-05-20 16:55:48 UTC ---
I this supposed to work too?

//  This is going to be a variadic array.
#include <cstddef>
#include <type_traits>

template<typename T, std::size_t Dim, std::size_t... Dims>
  struct tensor
  {
  public:
    typedef std::conditional<sizeof...(Dims) == 0, T, tensor<T, Dims...>>
_Elem;
    _Elem elem[Dim]; // (Dim == 0 ? 1 : Dim) like array?
  };



More information about the Gcc-bugs mailing list