From 63493709a92c76169ad065cc3804b13dbd786537 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 2 Sep 2014 11:15:58 -0500 Subject: add planner.cpp to the build --- src/planner.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/planner.cpp') diff --git a/src/planner.cpp b/src/planner.cpp index 3f73030..15dab52 100644 --- a/src/planner.cpp +++ b/src/planner.cpp @@ -19,6 +19,8 @@ #include +#include + namespace unity { namespace indicator { namespace datetime { @@ -35,6 +37,7 @@ Planner::~Planner() { } +#if 0 void Planner::set_range_to_calendar_month(const DateTime& dt) { @@ -59,6 +62,7 @@ Planner::set_range_to_upcoming_month(const DateTime& begin) end.format(fmt).c_str()); range().set(std::make_pair(begin,end)); } +#endif void Planner::sort(std::vector& appts) @@ -73,9 +77,9 @@ Planner::trim(std::vector& appts, const DateTime& begin, const DateTime& end) { - decltype(appts) tmp; - auto predicate = [begin,end](const Appointment& a){return begin<=a.begin && a.begin<=end;} - std::copy(std::begin(appts), std::end(appts), std::back_inserter(tmp), predicate); + std::vector tmp; + auto predicate = [begin,end](const Appointment& a){return begin<=a.begin && a.begin<=end;}; + std::copy_if(std::begin(appts), std::end(appts), std::back_inserter(tmp), predicate); appts.swap(tmp); } -- cgit v1.2.3