Last active
August 29, 2015 14:27
-
-
Save thiagomg/5d86f71a1f0b3ca1a96f to your computer and use it in GitHub Desktop.
range for - lookup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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