From f8cad451d35665032388199fc68565697f8dabf1 Mon Sep 17 00:00:00 2001 From: Maf Vosburgh Date: Sat, 8 Jun 2013 10:07:42 -0700 Subject: [PATCH] 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. --- opensubdiv/far/patchTables.h | 78 +++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/opensubdiv/far/patchTables.h b/opensubdiv/far/patchTables.h index cc59467a..e60c6ea9 100644 --- a/opensubdiv/far/patchTables.h +++ b/opensubdiv/far/patchTables.h @@ -200,15 +200,11 @@ public: class iterator; /// Returns an iterator to the first type of patch (REGULAR NON_TRANSITION ROT0) - static iterator begin() { - return iterator( Descriptor(REGULAR, NON_TRANSITION, 0) ); - } + static iterator begin(); /// Returns an iterator to the end of the list of patch types (NON_PATCH) - static iterator end() { - return iterator( Descriptor() ); - } - + static iterator end(); + private: template friend class FarPatchTablesFactory; friend class iterator; @@ -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 class PatchArray { @@ -505,6 +472,45 @@ private: 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 inline FarPatchTables::FarPatchTables(PatchArrayVector const & patchArrays,