From 94bffb5b9dad04c7a6e9bbcd16994711337a1d44 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 19 May 2010 03:24:07 +0000 Subject: [PATCH] Fix compile error in gcc introduced in r4307 (instantiating templates with private inner types is a msvc extension) Originally committed to SVN as r4311. --- aegisub/src/ass_file.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index 82da17f8b..8be39161f 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -287,7 +287,6 @@ bool AssFile::CanSave() { /// @brief even moving things out of order might break ASS parsing - AMZ. I strongly advice you against touching this function unless you know what you're doing; ------------------- Appends line to Ass /// @param data /// @param group -/// @param lasttime /// @param version /// @param outGroup /// @return @@ -493,7 +492,6 @@ void AssFile::InsertStyle (AssStyle *style) { AssEntry *curEntry; list::iterator lastStyle = Line.end(); list::iterator cur; - int lasttime = -1; wxString lastGroup; // Look for insert position @@ -992,14 +990,16 @@ bool AssFile::CompStyle(const AssDialogue* lft, const AssDialogue* rgt) { void AssFile::Sort(CompFunc comp) { Sort(Line, comp); } -void AssFile::Sort(std::list &lst, CompFunc comp) { - // uguu c++ closures uguu - struct : public std::binary_function { - CompFunc comp; +namespace { + struct AssEntryComp : public std::binary_function { + AssFile::CompFunc comp; bool operator()(const AssEntry* a, const AssEntry* b) const { return comp(static_cast(a), static_cast(b)); } - } compE; + }; +} +void AssFile::Sort(std::list &lst, CompFunc comp) { + AssEntryComp compE; compE.comp = comp; // Sort each block of AssDialogues separately, leaving everything else untouched for (entryIter begin = lst.begin(); begin != lst.end(); ++begin) {