www.digitalmars.com         C & C++   DMDScript  

c++ - type qualifiers and static can only appear in outermost array of

reply Paul Runde <prunde consolidated.net> writes:
This works with gcc

template<class T>
class foo
{
     void dothis(const T&);
};

template<class T> inline void foo<T>::dothis(const T& x)
{
}

foo<char[2048]> foostr;  //generates the error


Thanks,

Paul
Mar 12 2004
parent reply "Matthew" <matthew stlsoft.org> writes:
It looks like a bug, but does a typedef suffice as a workaround?

"Paul Runde" <prunde consolidated.net> wrote in message
news:c2t70v$28t7$1 digitaldaemon.com...
 This works with gcc

 template<class T>
 class foo
 {
      void dothis(const T&);
 };

 template<class T> inline void foo<T>::dothis(const T& x)
 {
 }

 foo<char[2048]> foostr;  //generates the error


 Thanks,

 Paul
Mar 18 2004
parent Paul Runde <prunde consolidated.net> writes:
typedef works as such:

typedef char c_t[2048];

foo<c_t*> foostr;

gcc accepts this.

Matthew wrote:
 It looks like a bug, but does a typedef suffice as a workaround?
 
 "Paul Runde" <prunde consolidated.net> wrote in message
 news:c2t70v$28t7$1 digitaldaemon.com...
 
This works with gcc

template<class T>
class foo
{
     void dothis(const T&);
};

template<class T> inline void foo<T>::dothis(const T& x)
{
}

foo<char[2048]> foostr;  //generates the error


Thanks,

Paul
Mar 18 2004