Error: Partial specialization

L

Laax

Hi all,

I get Partial Specilization error while trying to compile the
following code in environment [ Sun WorkShop 6 update 2 C++ 5.3 ]. I
could not locate the error. Please show me some light.

Thanks.

Here is the complete code(developed by someone else sometime back).
----------------------------------------------------------------
#include <ACValSrtArray.h>

template <class K, class V>
class ACDictItem <K, V>
{
public:
ACDictItem ();

ACDictItem (const K&);
ACDictItem (const K&, const V&);
ACDictItem (const ACDictItem& x);
~ACDictItem ();


ACDictItem<K, V>& operator= (const ACDictItem<K,V>& rhs);
friend int operator ==
(const ACDictItem<K,V>& lhs, const ACDictItem<K,V>&
rhs);
friend int operator !=
(const ACDictItem<K,V>& lhs, const ACDictItem<K,V>&
rhs);
friend int operator >
(const ACDictItem<K,V>& lhs, const ACDictItem<K,V>&
rhs);
friend int operator <
(const ACDictItem<K,V>& lhs, const ACDictItem<K,V>&
rhs);
friend int operator >=
(const ACDictItem<K,V>& lhs, const ACDictItem<K,V>&
rhs);
friend int operator <=
(const ACDictItem<K,V>& lhs, const ACDictItem<K,V>&
rhs);

K key;
V value;
};


template <class K, class V>
class ACValDictionary : public ACValSrtArray< ACDictItem<K, V> >
{
public:
ACValDictionary(int count = 32 );
ACValDictionary(const ACValDictionary<K, V>& from);
virtual ~ACValDictionary();

int containsKey (const K& key) const;

virtual int indexKey(const K& src) const;

virtual void insertKeyValue(const K& key, const V& value);
virtual void appendKeyValue(const K& key, const V& value);

virtual int removeKey(const K& src );
virtual int removeKeyAll(const K& src );

ACDictItem<K, V>& operator=( const ACDictItem<K, V>& rhs );
V operator[](const K&) const;
V& operator[](const K&);

V at (int) const;
V& at (int);

private:
};
 
D

David B. Held

Laax said:
[...]
#include <ACValSrtArray.h>

template <class K, class V>
class ACDictItem <K, V>
[...]

Umm...this is very weird. It appears to be a partial specialization,
but nothing is specialized. My guess is that the specialization
arguments are a typo. Try taking them out. E.g.:

template <class K, class V>
class ACDictItem

Also, try taking them out of all occurrences of ACDictItem in
the class definition, as they are redundant. And we all know
that redundancy causes confusion, hysteria, hiccups, measles,
and total thermonuclear destruction, so it must be avoided
at all costs.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top