Fix MacOS X build when using Apple LLVM compiler (Clang).

The order of defining the nested classes inside FarPatchTables confused
this rather strict compiler. Simply move the
FarPatchTables::Descriptor::iterator code a little later in the file to
remove the confusion.
This commit is contained in:
Maf Vosburgh 2013-06-08 10:07:42 -07:00
parent a0b2f56837
commit f8cad451d3

View File

@ -200,14 +200,10 @@ public:
class iterator; class iterator;
/// Returns an iterator to the first type of patch (REGULAR NON_TRANSITION ROT0) /// Returns an iterator to the first type of patch (REGULAR NON_TRANSITION ROT0)
static iterator begin() { static iterator begin();
return iterator( Descriptor(REGULAR, NON_TRANSITION, 0) );
}
/// Returns an iterator to the end of the list of patch types (NON_PATCH) /// Returns an iterator to the end of the list of patch types (NON_PATCH)
static iterator end() { static iterator end();
return iterator( Descriptor() );
}
private: private:
template <class T> friend class FarPatchTablesFactory; template <class T> friend class FarPatchTablesFactory;
@ -219,35 +215,6 @@ public:
}; };
/// \brief Descriptor iterator class
class Descriptor::iterator {
public:
/// Constructor
iterator() {}
/// Copy Constructor
iterator(Descriptor desc) : pos(desc) { }
/// Iteration increment operator
iterator & operator ++ () { ++pos; return *this; }
/// True of the two descriptors are identical
bool operator == ( iterator const & other ) const { return (pos==other.pos); }
/// True if the two descriptors are different
bool operator != ( iterator const & other ) const { return not (*this==other); }
/// Dereferencing operator
Descriptor * operator -> () { return &pos; }
/// Dereferencing operator
Descriptor & operator * () { return pos; }
private:
Descriptor pos;
};
/// \brief Describes an array of patches of the same type /// \brief Describes an array of patches of the same type
class PatchArray { class PatchArray {
@ -505,6 +472,45 @@ private:
int _maxValence; int _maxValence;
}; };
/// \brief Descriptor iterator class
class FarPatchTables::Descriptor::iterator {
public:
/// Constructor
iterator() {}
/// Copy Constructor
iterator(FarPatchTables::Descriptor desc) : pos(desc) { }
/// Iteration increment operator
iterator & operator ++ () { ++pos; return *this; }
/// True of the two descriptors are identical
bool operator == ( iterator const & other ) const { return (pos==other.pos); }
/// True if the two descriptors are different
bool operator != ( iterator const & other ) const { return not (*this==other); }
/// Dereferencing operator
FarPatchTables::Descriptor * operator -> () { return &pos; }
/// Dereferencing operator
FarPatchTables::Descriptor & operator * () { return pos; }
private:
FarPatchTables::Descriptor pos;
};
/// Returns an iterator to the first type of patch (REGULAR NON_TRANSITION ROT0)
inline FarPatchTables::Descriptor::iterator FarPatchTables::Descriptor::begin() {
return FarPatchTables::Descriptor::iterator( FarPatchTables::Descriptor(REGULAR, NON_TRANSITION, 0) );
}
/// Returns an iterator to the end of the list of patch types (NON_PATCH)
inline FarPatchTables::Descriptor::iterator FarPatchTables::Descriptor::end() {
return FarPatchTables::Descriptor::iterator( FarPatchTables::Descriptor() );
}
// Constructor // Constructor
inline inline
FarPatchTables::FarPatchTables(PatchArrayVector const & patchArrays, FarPatchTables::FarPatchTables(PatchArrayVector const & patchArrays,