title: typedef operator() is not compiling for std::map sort
body: <p>I am trying to compile a class where the std::map first is a class pointer.  When I created the class I forward declare the class but if I try to dereference the pointer it says the operator&lt; does not exit yet.  Since I am using the typedef in the class function arguments I can't move it to the bottom of the included because then the functions say FdTEcApplDataMap is not declared yet.   How do I get this class to compile?  Somehow I need to get FoEcApplDataPComp to see the operator&lt; include the class.</p>
  
  <pre><code>#ifndef _FoEcApplData_h_
  #define _FoEcApplData_h_
  
  #include &lt;boost/serialization/string.hpp&gt;
  
  class RWDlistCollectables ;
  
  #include "EcTypes.h"
  #include "EcBcArch.h" 
  
  const RWClassID FoCEcApplData = 90;
  
  // forward declare so we can declare FdTEcApplDataMap typedef
  class FoEcApplData;
  
  /*
  Custom KeyEqual for FoEcApplData class on FdTEcApplDataMap.  
  Needed since we are using pointers.
  
  Note:  Each FoEcApplData is unique so you can't be equal.
  
  Returns - true less then, false equal and greater
  
  lhs  - pointer to the item you are looking for
  rhs - pointer to an item on the list
  */
  struct FoEcApplDataPComp
  {
          bool operator()(FoEcApplData *const&amp; lhs, FoEcApplData *const&amp; rhs) const
      {
          return (*lhs &lt; *rhs);
      }
  };
  /*
  NOTE:
  You can NOT use the map find() call because the "operator&lt;" is testing the array 
  length vs. what's inside the array.  Instead you must use FoEcApplData.find().
  */
  typedef std::map&lt;FoEcApplData *, std::string, FoEcApplDataPComp&gt; FdTEcApplDataMap;
  
  
  // FoEcApplData : public EcRwCollectable
  // 
  //   This is the application data for a directive.  That is the binary for
  // the directive alone without a packet header. 
  
  class FoEcApplData : public EcRwCollectable {
  
      EcMBcArchSplitDeclareClass(FoEcApplData,EcRwCollectable)
  
  public:
  
      // FoEcApplData
      //
      // Default Constructor. 
  
      FoEcApplData() ; 
  
      // FoEcApplData
      //
      // Copy Constructor. 
  
      FoEcApplData( const FoEcApplData&amp; object ) ;
  
      // FoEcApplData
      //
      // Destructor. 
  
      virtual ~FoEcApplData() ; 
  
      // operator=
      //
      // Set this object equal to input object.  
  
      FoEcApplData&amp; operator=( const FoEcApplData&amp; object) ;
  
      // operator==
      //
      // Test to see if this is equal to input object. 
  
      bool operator==( const FoEcApplData&amp; object) const ;
  
      // operator&lt;
      //
      // Test to see if input object is less than input object. 
  
      bool operator&lt;( const FoEcApplData&amp; object) const ;
  
      // operator&gt;
      //
      // Test to see if input object is greater than input object. 
  
      bool operator&gt;( const FoEcApplData&amp; object) const ;
  
      // operator+=
      //
      // Add the input applicationsd data to my own appending
      // to end of binary array.   Returns a reference to self.
  
      FoEcApplData&amp; operator+=( const FoEcApplData&amp; object ) ;  
  
      /*
      Print out the class in a human readable format
  
      Returns - output stream
      os - output stream
      orig - Reference to class so we can print it out
      */
      friend std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, const FoEcApplData&amp; orig);
  
      // find
      //
      // The std::map find call can't work because the operator&lt; is not testing the array contented.
      // This will loop through the map key and compare each once for a match.
      //
      // returns - the iterator for the search
      //
      // applDataMap - the map list reference
      // object - The object you are trying to find in the map list
  
      FdTEcApplDataMap::const_iterator find(const FdTEcApplDataMap&amp; applDataMap, const FoEcApplData * pObject);
      // Data
      //
      // Get the binary data. 
  
      inline const EcTOctet* Data() const; 
  
      // NumOfBytes
      //
      // Size of the binary in bytes.  0 indicates no binary data. 
  
      inline EcTInt NumOfBytes() const; 
  
      // Data
      //
      // Set the binary. I take possesion of the data. 
  
      inline EcTVoid Data( EcTOctet* data , const EcTInt&amp; dataSize ) ;
  
      // binaryStoreSize
      // 
      // Computes the size of the class when stored using saveGuts.
  
      virtual RWspace binaryStoreSize() const ; 
  
      // hash
      //
      // Returns a value suitable for a hash table. 
  
      virtual EcTUInt hash() const ; 
  
      // restoreGuts
      // 
      // Recreates a class from file. (persistance)
      //
      // RWFileErr - thrown on file error. 
  
      virtual EcTVoid restoreGuts( RWFile&amp; file) ;
  
      // restoreGuts
      //
      // Recreates a class from stream. (persistance)
  
      virtual EcTVoid restoreGuts( RWvistream&amp; inStream ) ;
  
      // saveGuts
      // 
      // Saves a class to a file. (persistance)
      //
      // RWFileErr - thrown on file error. 
  
      virtual EcTVoid saveGuts( RWFile&amp; file) const ;
  
      // saveGuts
      // 
      // Saves a class to a stream. (persistance)
  
      virtual EcTVoid saveGuts( RWvostream&amp; outStream ) const ;
  
      // getDataMemberDifferences
      // 
      // Compare the all of the data members that are streamed out.
      // Returns true if it found descrepancies. It also fills a collection 
      // with strings containing all of the differences and possible
      // causes
  
      virtual EcTBoolean 
      getDataMemberDifferences(
          const FoEcApplData* compareApplData,
          RWDlistCollectables&amp; listOfDescrepancies) const;
  
  private:
  
      // The actual data (binary).  This is a pointer to an array of 
      // EcTOctet that is myNumOfBytes long.  
  
      EcTOctet* myData; 
  
      // The length of the binary in bytes.
  
      EcTInt myNumOfBytes; 
  
  };
  
  // Include inline functions...
  #ifndef OUTLINE
  #include "FoEcApplData.iC" 
  #endif
  
  BOOST_CLASS_EXPORT_KEY(FoEcApplData)
  
  #endif
  </code></pre>