C++11 transition fixes

- comparison of weak-pointers
This commit is contained in:
Fischlurch 2014-04-05 22:20:38 +02:00
parent bb5db0ebd5
commit 761bab5647
5 changed files with 23 additions and 2 deletions

View file

@ -35,8 +35,10 @@
#include "gui/widgets/timeline/timeline-zoom-scale.hpp"
#include "lib/time/timevalue.hpp"
#include "lib/util-coll.hpp"
#include <memory>
#include <map>
using namespace gui::widgets;
@ -178,6 +180,7 @@ private:
std::map< weak_ptr<model::Sequence>
, shared_ptr<widgets::timeline::TimelineState>
, ::util::WeakPtrComparator
>
timelineStates;

View file

@ -29,9 +29,13 @@
#include <boost/foreach.hpp>
#include <memory>
#include <list>
using std::pair;
using std::list;
using std::shared_ptr;
using std::weak_ptr;
using std::dynamic_pointer_cast;
using namespace Gtk;
using namespace lumiera;

View file

@ -163,5 +163,19 @@ namespace util {
/* === generic container helpers === */
struct WeakPtrComparator
{
template<typename T>
bool
operator() (std::weak_ptr<T> const& l, std::weak_ptr<T> const& r) const
{
return l.lock().get() < r.lock().get();
}
};
} // namespace util
#endif /*UTIL_COLL_H*/

View file

@ -65,7 +65,7 @@ namespace test {
bool
find (const string& pID)
{
return Session::current->defaults.search (Query<Pipe> ("pipe("+pID+")"));
return bool(Session::current->defaults.search (Query<Pipe> ("pipe("+pID+")")));
}

View file

@ -65,7 +65,7 @@ namespace test {
bool
find (Query<Pipe>& q)
{
return Session::current->defaults.search (q);
return bool(Session::current->defaults.search (q));
}