[Insight-users] Defining a map of IndexTypes

Matthias Dodt matthias.dodt at mdc-berlin.de
Tue Oct 27 12:00:20 EDT 2009


Hi there!

I want to store IndexTypes in a map (as keys). I got the following code:
         
   ...

            typedef typename    TImageType::IndexType       IndexType;

            bool fless(const IndexType& lhs, const IndexType& rhs) const
            {
              //y1 is lower y2
              if(lhs[1]<rhs[1])return true;
              //y1==y2 and x1 < x2
              if((lhs[1]==rhs[1])&&(lhs[0]<rhs[0]))return true;
              //else
              return false;
            }

            typedef bool (*comp_t)( IndexType const &, IndexType const & );

            std::map<IndexType, bool, comp_t> recursionPoints(fless);

...

Anyway- i get an error saying that fless has no type. I think the 
problem is that IndexType is a template type...

thanks!




More information about the Insight-users mailing list