Commit Graph

7 Commits

Author SHA1 Message Date
Jørgen Kvalsvik
0d24ac2d4a Store Location::lineno as size_t
By storing it as size_t we explicitly disallow negative line numbers,
and keep 0 as an error/empty/undefined location.

A small problem with this is that MessageContainer.error and friends
still accept negative numbers (often without warning) via size_t
implicit conversion and wrap-around.
2016-04-06 11:41:22 +02:00
Jørgen Kvalsvik
f3bef79562 MessageContainer::const_iterator bound
While the implementation is a simple alias to
std::vector<Message>::const_iterator, it enablese generic lookup of the
iterator type at compile time, and enables us to effortlessly change the
underlying implementation later.
2016-04-06 10:38:19 +02:00
Jørgen Kvalsvik
6c8487ea07 Message::location uses automatic members
By supporting operator bool() we get the same existence checking
capabilities as the unique_ptr implementations, without the hurdles of
non-copyability and manual heap allocation.
2016-04-06 10:38:13 +02:00
Liu Ming
1f44ade6c7 Add range based test. 2016-03-29 10:21:10 +08:00
Liu Ming
aea8d7a5bf test iterator. 2016-03-28 08:52:56 +08:00
Liu Ming
9828cdc1d9 fix copy right. 2016-03-25 11:21:43 +08:00
Liu Ming
b53d0909ba add tests for message container. 2016-03-25 10:55:22 +08:00