Skip to content

Commit

Permalink
Unneeded include of <iostream>, change of begin() and end() as issue #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hana Dusíková committed Oct 24, 2017
1 parent b225e6b commit d1a7ca4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: all clean

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

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

Expand Down
1 change: 0 additions & 1 deletion include/pregexp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "static-regexp/string.hpp"
#include "static-regexp/static-regexp.hpp"

#include <iostream>
#include <cassert>

/*
Expand Down
4 changes: 2 additions & 2 deletions include/static-regexp/static-regexp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ class DynamicMemory {
data.emplace_back(std::forward<PositionPair>(pair));
}
const PositionPair * begin() const {
return &*data.cbegin();
return data.empty() ? nullptr : &data.front();
}
const PositionPair * end() const {
return &*data.cend();
return data.empty() ? nullptr : &data.back() + 1;
}
CatchRange getRange() const {
return {begin(),end()};
Expand Down

0 comments on commit d1a7ca4

Please sign in to comment.