www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Bug: mistakes compile-time multiplication in template param list for VLA

↑ ↓ ← "Matthew" <admin stlsoft.dot.dot.dot.dot.org> writes:
Compiling STLSoft's static_array classes gives

    H:\STLSoft\Identities\STLSoft\stlsoft\stlsoft_static_array.h(730) 
: Error: variable length arrays are only for function prototypes and 
autos

Essentially, the class template is declared like this

template<   typename T
        ,   size_t N0
        ,   size_t N1
        ,   size_t N2
        ,   size_t N3
        ,   typename P   =   do_construction<T>
        ,   typename M   =   T[N0 * N1 * N2 * N3]
        >
class static_array_4d
{

    . . .

    M   m_data;    // <= This is the line (730) that causes the 
problem
};


I've tried boiling it down, but it eludes me. I've included a test 
file incorporates the same structure, but fails to elicit the error

It'd be great if this can be found and fixed for 8.44, as I suspect 
STLSoft 1.8.4 will be releasable at the same time.

Cheers

Matthew
Apr 26 2005
↑ ↓ "Walter" <newshound digitalmars.com> writes:
"Matthew" <admin stlsoft.dot.dot.dot.dot.org> wrote in message
news:d4n73h$6k9$1 digitaldaemon.com...
 I've tried boiling it down, but it eludes me. I've included a test
 file incorporates the same structure, but fails to elicit the error

I'm afraid that a test case that doesn't produce the error is not terribly useful.
May 17 2005
↑ ↓ → "Matthew" <admin stlsoft.dot.dot.dot.dot.org> writes:
"Walter" <newshound digitalmars.com> wrote in message 
news:d6ejip$1e4j$1 digitaldaemon.com...
 "Matthew" <admin stlsoft.dot.dot.dot.dot.org> wrote in message
 news:d4n73h$6k9$1 digitaldaemon.com...
 I've tried boiling it down, but it eludes me. I've included a 
 test
 file incorporates the same structure, but fails to elicit the 
 error

I'm afraid that a test case that doesn't produce the error is not terribly useful.

:-)
May 17 2005