Error: Partial specialization

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Laax

    Error: Partial specialization

    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 ~ACValDictionar y();

    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(co nst 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:
    };

    --------------------------------------------------------------

    Laax.
  • David B. Held

    #2
    Re: Error: Partial specialization

    "Laax" <maillaax@yahoo .co.jp> wrote in message
    news:33d628bd.0 310071738.7d0ea 07f@posting.goo gle.com...[color=blue]
    > [...]
    > #include <ACValSrtArray. h>
    >
    > template <class K, class V>
    > class ACDictItem <K, V>
    > [...][/color]

    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



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.521 / Virus Database: 319 - Release Date: 9/23/2003


    Comment

    Working...