Skip to content

Commit d1a7ca4

Browse files
author
Hana Dusíková
committed
Unneeded include of <iostream>, change of begin() and end() as issue #2.
1 parent b225e6b commit d1a7ca4

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: all clean
22

33
# -ftemplate-depth-1024 -ftemplate-backtrace-limit=0
4-
override CXXFLAGS += -std=c++1z -Wno-gnu-string-literal-operator-template -O3
4+
override CXXFLAGS += -std=c++1z -Wno-gnu-string-literal-operator-template -O3 -Iinclude
55

66
override TARGETS := math regexp pregexp code-size-test catch-regexp-example
77

include/pregexp.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "static-regexp/string.hpp"
33
#include "static-regexp/static-regexp.hpp"
44

5-
#include <iostream>
65
#include <cassert>
76

87
/*

include/static-regexp/static-regexp.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ class DynamicMemory {
123123
data.emplace_back(std::forward<PositionPair>(pair));
124124
}
125125
const PositionPair * begin() const {
126-
return &*data.cbegin();
126+
return data.empty() ? nullptr : &data.front();
127127
}
128128
const PositionPair * end() const {
129-
return &*data.cend();
129+
return data.empty() ? nullptr : &data.back() + 1;
130130
}
131131
CatchRange getRange() const {
132132
return {begin(),end()};

0 commit comments

Comments
 (0)