Skip to content

DynamicMemory::end() causes "vector iterator not dereferencable" #2

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
BenHanson opened this issue Oct 23, 2017 · 0 comments
Closed

Comments

@BenHanson
Copy link

BenHanson commented Oct 23, 2017

Changing it to:

	const PositionPair *end() const {
		return data.empty() ? nullptr : &data.back() + 1;
	}

works fine.

EDIT:

Also change begin() to check for empty vector:

const PositionPair * begin() const {
	return data.empty() ? nullptr : &data.front();
}
jmramosr added a commit to jmramosr/compile-time-regular-expressions that referenced this issue Sep 16, 2020
added CTRE_V2__CTLL__HPP redundant guard
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants