Skip to content

Instantly share code, notes, and snippets.

@thiagomg
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiagomg/5d86f71a1f0b3ca1a96f to your computer and use it in GitHub Desktop.
Save thiagomg/5d86f71a1f0b3ca1a96f to your computer and use it in GitHub Desktop.
range for - lookup
auto getMonthlyFlow(int year, int month) -> CashRange<CashMap>
{
int kb = (year * 10000) + (month * 100) + 00;      
int ke = (year * 10000) + (month * 100) + 31;
const auto b = _flow.lower_bound(kb);
if( b == _flow.end() ) {
return CashRange<CashMap>(_flow.cend(), _flow.cend());
}
const auto e = _flow.upper_bound(ke);
return CashRange<CashMap>(b, e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment