Skip to content

Commit

Permalink
Update main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooophy committed Dec 1, 2014
1 parent 2d7b63e commit 21560a1
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions ch10/ex10_12/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
#include <numeric>
#include <wy_sales_data.h>

//! Exercise 10.12
//! @note the predicate here provides a logic to the algorithm to follow.
//! @attention a predicate must return a bool.
bool
compareIsbn(const wy_Sales_data &sd1, const wy_Sales_data &sd2);
inline bool
compareIsbn(const wy_Sales_data &sd1, const wy_Sales_data &sd2)
{
return sd1.isbn().size() < sd2.isbn().size();
}


int main()
{
wy_Sales_data d1("aa"), d2("aaaa"), d3("aaa"), d4("z"), d5("aaaaz");
Expand All @@ -31,8 +33,3 @@ int main()

return 0;
}
bool
compareIsbn(const wy_Sales_data &sd1, const wy_Sales_data &sd2)
{
return sd1.isbn().size() < sd2.isbn().size();
}

0 comments on commit 21560a1

Please sign in to comment.