Switch to boost.container for containers of incomplete types

STL containers are not required to support incomplete types, and while
most implementations do, clang's libc++ does not.
This commit is contained in:
Thomas Goyne 2012-09-24 16:47:38 -07:00
parent dfa4f33f25
commit 28175aadbe
11 changed files with 26 additions and 21 deletions

View file

@ -20,7 +20,6 @@
#include <stdint.h>
#include <fstream>
#include <map>
#include <vector>
#endif

View file

@ -19,13 +19,13 @@
#pragma once
#ifndef LAGI_PRE
#include <boost/container/map.hpp>
#ifdef _WIN32
#include <functional>
#include <map>
#include <memory>
#else
#include <tr1/functional>
#include <map>
#include <tr1/memory>
#endif
#endif
@ -141,7 +141,7 @@ namespace detail {
template<class Slot>
class SignalBaseImpl : public SignalBase {
protected:
typedef std::map<ConnectionToken*, Slot> SlotMap;
typedef boost::container::map<ConnectionToken*, Slot> SlotMap;
SlotMap slots; /// Signals currently connected to this slot

View file

@ -59,6 +59,10 @@
#include <tr1/memory>
#endif
// Boost
#include <boost/container/list.hpp>
#include <boost/container/map.hpp>
#ifdef __DEPRECATED // Dodge GCC warnings
# undef __DEPRECATED
# include <strstream>

View file

@ -33,7 +33,8 @@
///
#ifndef AGI_PRE
#include <list>
#include <boost/container/list.hpp>
#include <set>
#include <vector>
@ -55,8 +56,8 @@ typedef std::list<AssEntry*>::iterator entryIter;
///
/// DOCME
class AssFile {
std::list<AssFile> UndoStack;
std::list<AssFile> RedoStack;
boost::container::list<AssFile> UndoStack;
boost::container::list<AssFile> RedoStack;
wxString undoDescription;
/// Revision counter for undo coalescing and modified state tracking
int commitId;

View file

@ -33,7 +33,8 @@
///
#ifndef AGI_PRE
#include <map>
#include <boost/container/map.hpp>
#include <tr1/memory>
#include <vector>
@ -45,7 +46,7 @@ struct OpenGLTextGlyph;
class OpenGLTextTexture;
/// DOCME
typedef std::map<int,OpenGLTextGlyph> glyphMap;
typedef boost::container::map<int,OpenGLTextGlyph> glyphMap;
/// DOCME
/// @class OpenGLText

View file

@ -34,7 +34,7 @@
#ifndef AGI_PRE
#include <deque>
#include <map>
#include <boost/container/map.hpp>
#include <vector>
#include <wx/panel.h>
@ -136,7 +136,7 @@ class SubsEditBox : public wxPanel {
/// The start and end times of the selected lines without changes made to
/// avoid negative durations, so that they can be restored if future changes
/// eliminate the negative durations
std::map<AssDialogue *, std::pair<AssTime, AssTime> > initialTimes;
boost::container::map<AssDialogue *, std::pair<AssTime, AssTime> > initialTimes;
// Constructor helpers
wxTextCtrl *MakeMarginCtrl(wxString const& tooltip, void (SubsEditBox::*handler)(wxCommandEvent&));

View file

@ -33,7 +33,7 @@
///
#ifndef AGI_PRE
#include <list>
#include <boost/container/list.hpp>
#endif
struct ToolTipBinding;
@ -52,7 +52,7 @@ class ToolTipManager {
ToolTipManager(ToolTipManager const&);
ToolTipManager& operator=(ToolTipManager const&);
std::list<ToolTipBinding> tips;
boost::container::list<ToolTipBinding> tips;
public:
static void Bind(wxWindow *window, wxString tooltip, const char *context, const char *command);

View file

@ -63,7 +63,7 @@ const AegiVideoFrame VideoProviderCache::GetFrame(int n) {
size_t total_size = 0;
// See if frame is cached
for (std::list<CachedFrame>::iterator cur = cache.begin(); cur != cache.end(); ++cur) {
for (boost::container::list<CachedFrame>::iterator cur = cache.begin(); cur != cache.end(); ++cur) {
if (cur->frame_number == n) {
cache.push_front(*cur);
cache.erase(cur);

View file

@ -33,7 +33,7 @@
///
#ifndef AGI_PRE
#include <list>
#include <boost/container/list.hpp>
#endif
#include "include/aegisub/video_provider.h"
@ -55,7 +55,7 @@ class VideoProviderCache : public VideoProvider {
const size_t max_cache_size;
/// Cache of video frames with the most recently used ones at the front
std::list<CachedFrame> cache;
boost::container::list<CachedFrame> cache;
public:
VideoProviderCache(VideoProvider *master);

View file

@ -161,8 +161,8 @@ template<class FeatureType>
class VisualTool : public VisualToolBase {
protected:
typedef FeatureType Feature;
typedef typename std::list<FeatureType>::iterator feature_iterator;
typedef typename std::list<FeatureType>::const_iterator feature_const_iterator;
typedef typename boost::container::list<FeatureType>::iterator feature_iterator;
typedef typename boost::container::list<FeatureType>::const_iterator feature_const_iterator;
private:
struct ltaddr {
@ -172,7 +172,7 @@ private:
}
};
std::list<agi::signal::Connection> slots;
boost::container::list<agi::signal::Connection> slots;
typedef typename std::set<feature_iterator, ltaddr>::iterator selection_iterator;
@ -203,7 +203,7 @@ protected:
feature_iterator active_feature;
/// List of features which are drawn and can be clicked on
/// List is used here for the iterator invalidation properties
std::list<FeatureType> features;
boost::container::list<FeatureType> features;
/// Draw all of the features in the list
void DrawAllFeatures();

View file

@ -27,7 +27,7 @@
class VisualToolDragDraggableFeature : public VisualDraggableFeature {
public:
int time;
std::list<VisualToolDragDraggableFeature>::iterator parent;
boost::container::list<VisualToolDragDraggableFeature>::iterator parent;
VisualToolDragDraggableFeature() : VisualDraggableFeature(), time(0) { }
};