[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
multiple storage classes in declaration
From: |
Milburn Young |
Subject: |
multiple storage classes in declaration |
Date: |
Fri, 20 Jul 2007 16:49:31 -0000 |
User-agent: |
G2/1.0 |
I was working with traits and policies and created regular type traits
and volatile type traits. However, when I was testing to see what
other type traits I could create, I found that I couldn't create any.
I got "error: multiple storage classes in declaration of..." for
'auto', 'register', 'restrict', and 'mutable'. I know how to use
these keywords otherwise, but I was wondering why my 'typedef's were
not liked, especially since 'auto' is implied. In the case of the
'mutable' typedef, I got "error: non-object member `value_type' cannot
be declared `mutable'". I searched on the Internet and found a couple
of projects that had 'mutable' typedefs.
template<typename TYPE>
class AutoTraits
{
public: typedef auto TYPE value_type;
public: typedef auto value_type *pointer;
// public: typedef auto const value_type *const_pointer;
public: typedef auto value_type& reference;
// public: typedef auto const value_type& const_reference;
public: typedef auto std::size_t size_type;
public: typedef auto std::ptrdiff_t difference_type;
};
c++ -pedantic -W -Wall -Wcast-qual -Wconversion -Wmissing-prototypes -
Wno-
import -Wpointer-arith -Wno-non-template-friend -Woverloaded-virtual -
Wwrite-strings -ftem
plate-depth-99 -O3 -c TraitsMain.cpp -o TraitsMain.o;
TraitsMain.cpp:64: error: multiple storage classes in declaration of
`value_type'
TraitsMain.cpp:65: error: multiple storage classes in declaration of
`pointer'
TraitsMain.cpp:67: error: multiple storage classes in declaration of
`reference'
TraitsMain.cpp:69: error: multiple storage classes in declaration of
`size_type'
TraitsMain.cpp:70: error: multiple storage classes in declaration of
`difference_type'
Milburn Young
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- multiple storage classes in declaration,
Milburn Young <=