Remove scoped_ptr::swap

Originally committed to SVN as r6431.
This commit is contained in:
Thomas Goyne 2012-02-02 19:18:10 +00:00
parent d68a7e81b0
commit b8a7c6cb1e
6 changed files with 13 additions and 12 deletions

View file

@ -24,6 +24,10 @@
#include "libaegisub/io.h" #include "libaegisub/io.h"
#include "libaegisub/line_iterator.h" #include "libaegisub/line_iterator.h"
#ifndef LAGI_PRE
#include <cstdlib>
#endif
template<class String, class Char, class Container> template<class String, class Char, class Container>
static void split(String const& str, Char sep, Container *out) { static void split(String const& str, Char sep, Container *out) {
typename String::size_type pos, prev = 0; typename String::size_type pos, prev = 0;

View file

@ -20,10 +20,6 @@
#pragma once #pragma once
#ifndef LAGI_PRE
#include <algorithm>
#endif
namespace agi { namespace agi {
/// @class scoped_ptr /// @class scoped_ptr
@ -48,14 +44,8 @@ public:
ptr = p; ptr = p;
} }
void swap(scoped_ptr &b) { using std::swap; swap(ptr, b.ptr); }
explicit scoped_ptr(T *ptr = 0) : ptr(ptr){ } explicit scoped_ptr(T *ptr = 0) : ptr(ptr){ }
~scoped_ptr() { delete ptr; } ~scoped_ptr() { delete ptr; }
}; };
template<class T>
inline void swap(scoped_ptr<T> &a, scoped_ptr<T> &b) {
a.swap(b);
}
} }

View file

@ -28,6 +28,8 @@
#ifndef AGI_PRE #ifndef AGI_PRE
#include <vector> #include <vector>
#include <wx/string.h>
#endif #endif
class AudioMarkerKeyframe; class AudioMarkerKeyframe;
@ -35,14 +37,15 @@ class Pen;
class VideoContext; class VideoContext;
class TimeRange; class TimeRange;
class VideoPositionMarker; class VideoPositionMarker;
class wxPen;
#include "time_range.h"
namespace agi { namespace agi {
class OptionValue; class OptionValue;
struct Context; struct Context;
} }
#include "time_range.h"
/// @class AudioMarker /// @class AudioMarker
/// @brief A marker on the audio display /// @brief A marker on the audio display
class AudioMarker { class AudioMarker {

View file

@ -26,6 +26,8 @@
#include "dialog_selection.h" #include "dialog_selection.h"
#ifndef AGI_PRE #ifndef AGI_PRE
#include <algorithm>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/combobox.h> #include <wx/combobox.h>
#include <wx/msgdlg.h> #include <wx/msgdlg.h>

View file

@ -38,6 +38,7 @@
#include <wx/dataview.h> #include <wx/dataview.h>
#include <wx/regex.h> #include <wx/regex.h>
#include <algorithm>
#include <list> #include <list>
#include <set> #include <set>
#endif #endif

View file

@ -37,6 +37,7 @@
#include <libaegisub/log.h> #include <libaegisub/log.h>
#ifndef AGI_PRE #ifndef AGI_PRE
#include <algorithm>
#include <deque> #include <deque>
#include <sstream> #include <sstream>
#include <vector> #include <vector>