error C3211: 'std::greater<cEvent::Ptr>': explicit specialization is using partial specialization syntax, use template<> instead

Hi,
When I try to compile my code, i got the following error message
*****
error C3211: 'std::greater<cEvent::Ptr>': explicit specialization is using partial specialization syntax, use template<> instead
*****
 The change i made in my code is to turn template<> to template<class _Ty>.
If I try to remove this modification from my code, I get the following error message
*******
error C2065: '_Ty': undeclared identifier
******

You'll find the following comment in front of the "wrong" line
// THE "WRONG LINE"

//*******************************
#include "resource.h"

class cEvent
{
private:
  cTimeCode Tc;
  wstring Comment;
public:
  typedef cEvent* Ptr;

  cEvent();
  virtual ~cEvent();

  void set(cTimeCode tc,wstring comment);
  void print();

  cTimeCode tc();
  wstring comment();

  void createComment(
    cUnknownPtr<IAAFDictionary> pDictionary,
    cUnknownPtr<IAAFDataDef> pDataDef,
    cUnknownPtr<IAAFSequence> pSequence);
};

template<class _Ty> // THE "WRONG LINE"
struct std::greater<cEvent::Ptr> : binary_function<_Ty, _Ty, bool>
{
  bool operator()(const _Ty& x, const _Ty& y) const
  {
    return y->tc() > x->tc();
  }
};

//*******************************

ANY CLUES ???
racinecondeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rajeev_devinCommented:
This time there is no error.
Please post the complete code.
>> cTimeCode Tc; like this
AlexFMCommented:
template<>
struct std::greater<cEvent::Ptr> : binary_function<cEvent::Ptr, cEvent::Ptr, bool>
{
  bool operator()(const cEvent::Ptr& x, const cEvent::Ptr& y) const
  {
    return y->tc() > x->tc();
  }
};

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
racinecondeAuthor Commented:
This seams to work
//**
template<>
struct std::greater<cEvent::Ptr> : binary_function<cEvent::Ptr, cEvent::Ptr, bool>
{
  bool operator()(const cEvent::Ptr& x, const cEvent::Ptr& y) const
  {
    return y->tc() > x->tc();
  }
};
//********

Thanks Alex

Rajeev, here's the complete code of cTimeCode

//*********
enum eFps {e24fps=24, e25fps=25, e30fps=30, e60fps=60};
typedef wstring String;
typedef wchar_t Char;

class cTimeCode
{
public:
  cTimeCode (int hour, int minute, int second, int frame, eFps fps, bool dropFrame=false);
  cTimeCode (int framesSinceMidnight, eFps fps, bool dropFrame=false);
  cTimeCode (wstring tc, eFps fps, bool dropFrame=false);
  cTimeCode (const cTimeCode& other);
  cTimeCode ();

  cTimeCode& operator += (int frames);
  cTimeCode& operator += (const cTimeCode& timecode);
  cTimeCode& operator -= (int frames);
  cTimeCode& operator -= (const cTimeCode& timecode);

  bool operator == (const cTimeCode &time) const;
  bool operator != (const cTimeCode &time) const;
  bool operator <  (const cTimeCode &time) const;
  bool operator <= (const cTimeCode &time) const;
  bool operator >  (const cTimeCode &time) const;
  bool operator >= (const cTimeCode &time) const;

  void incWithLimit (int frames);

  wstring toString() const;

  int framesSinceMidnight() const;
  void setFramesSinceMidnight (int framesSinceMidnight);

  int maxFrames() const;

  unsigned int getPacked() const;
  void setFromPacked (unsigned int packedTimeCode);

  unsigned char hour() const;
  unsigned char minute() const;
  unsigned char second() const;
  unsigned char frame() const;

  eFps fps() const;
  bool isDropFrame() const;

  int getFramesPerDay();

//{{{
private:
  unsigned char Hour;
  unsigned char Minute;
  unsigned char Second;
  unsigned char Frame;
  int FramesSinceMidnight;
  bool DropFrame;
  eFps Fps;

  int FramesPerDay;

  //{{{
  int limit (int num, int min, int max)         // worth inlining
    {
    if (num < min) return min;
    if (num > max) return max;
    return num;
    }
  //}}}
  void checkDropFrameState();
  void updateFramesPerDay();
  void framesToTimeCode();
  void timeCodeToFrames();
//}}}
};


inline wostream& __cdecl
operator<<(wostream& s,const cTimeCode& tc)
{
  s << tc.toString();
  return (s);
}

//*********

Thanks all for your help...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual C++.NET

From novice to tech pro — start learning today.