-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Bug report exercise 16.12 #211
Copy link
Copy link
Open
Description
Exercise information
Exercise 16.12
Question or Bug
Bug, end() and cend() member function of Blob have incorrect boundary check condition.
e.g.
#include "ex16_12_blob.h"
#include <iostream>
#include <string>
int main()
{
Blob<std::string> sb1{"a", "b", "c"};
auto p{sb1.cbegin()};
std::cout << *p << std::endl;
}
Code above will throw exception as follow:
terminate called after throwing an instance of 'std::out_of_range'
what(): dereference past endAnd the member function end() has the same problem.
Your enviroment information
- System: Ubuntu 20.04
- Compiler version/IDE: gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels