Style changes for main antlr4 codebase

- Add "explicit" to Interval(size_t, size_t) constructor.
- Change an IntervalSet constructor to delegate part of the construction

- Add "explicit" to Interval(size_t, size_t) constructor.
- Change an IntervalSet constructor to delegate part of the construction
This commit is contained in:
Jan Mikkelsen 2017-10-30 07:42:20 +11:00
parent 0f6082eb15
commit 3041b8e012
2 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,7 @@ namespace misc {
ssize_t b;
Interval();
Interval(size_t a_, size_t b_); // For unsigned -> signed mappings.
explicit Interval(size_t a_, size_t b_); // For unsigned -> signed mappings.
Interval(ssize_t a_, ssize_t b_);
/// return number of elements between a and b inclusively. x..x is length 1.

View File

@ -21,7 +21,8 @@ IntervalSet const IntervalSet::EMPTY_SET;
IntervalSet::IntervalSet() : _intervals() {
}
IntervalSet::IntervalSet(const IntervalSet &set) : _intervals(set._intervals) {
IntervalSet::IntervalSet(const IntervalSet &set) : IntervalSet() {
_intervals = set._intervals;
}
IntervalSet::IntervalSet(IntervalSet&& set) : IntervalSet(std::move(set._intervals)) {