llvm-project
llvm-project copied to clipboard
std::regex_iterator
auto f_regex_iterator() {
static const std::string s = "Quick brown fox.";
static std::regex words_regex("[^\\s]+");
return std::sregex_iterator(s.begin(), s.end(), words_regex); // TODO
}
in lifetime-integration-tests/lifetime-attr-test.cpp
While the example itself is compelling I am not sure if this should be addressed now. My main concern is, often times we can have one piece of logic to address a large number of functions such as begin, data, c_str. I am not sure if it is worth to add one new rule for one single function. This will definitely be caught once all the methods are annotated and we use the annotations though :)
sregex_iterator is not a function, it's an iterator type that we explicitly annotate as gsl::Pointer. I guess it does not work here, because it's constructor does not take a single argument (some Owner).
Oh, I see! Yeah, this make sense.