Reputation: 7333
I have found several questions asking about template typedefs in C++0x, which are resolved with the using
keyword; however, with GCC 4.6.1 (running g++ -std=c++0x
), I get the following error:
error: expected unqualified-id before ‘using’
Can you help me find where I'm going wrong? I've been trying to solve this for hours...
Code:
#include <map>
template<typename INDEX, typename VALUE>
class GenericSparseVector
{
protected:
std::map<INDEX, VALUE> indices_to_values;
};
template <typename VALUE>
using StandardSparseVector = GenericSparseVector<int, VALUE>;
Upvotes: 4
Views: 1806