在叮当声中regex_constants实现错误
Wrong implementation for regex_constants in clang?
如标准中指定:
match_prev_avail
: --first 是一个有效的迭代器位置。设置后,会导致忽略match_not_bol和match_not_bow
但是我运行以下代码并得到:
#include <regex>
#include <iostream>
using namespace std;
int main()
{
regex re0("^bcd");
string str = "abcd";
std::string::iterator start = str.begin() + 1;
cout << regex_search(start, str.end(), re0, regex_constants::match_not_bol) << endl;
cout << regex_search(start, str.end(), re0, regex_constants::match_prev_avail) << endl;
cout << regex_search(start, str.end(), re0, regex_constants::match_prev_avail | regex_constants::match_not_bol) << endl;
}
输出:
0
1
0
似乎match_prev_avail
被match_not_bol
覆盖了.
似乎你在叮当声中发现了一个错误。(在这里提交:https://bugs.llvm.org/,因为它似乎还没有被报道(
我检查了 MSVC 1914,它给出了
0
0
0
与 GCC 4.9.2 相同(用于 cpp.sh 检查(
我重新检查了标准的.pdf形式(N4810(,这在 30.5.2 中与 cpp首选项所述相匹配。
match_prev_avail: --first 是一个有效的迭代器位置。设置此标志时,正则表达式应忽略match_not_bol和match_not_bow标志 算法 (30.11( 和迭代器 (30.12(
相关文章:
- 如果没有malloc,链表实现将失败
- 如何在c++中实现处理器调度模拟器
- 如何在c++中使用引用实现类似python的行为
- 实现无开销push_back的最佳方法是什么
- 使用简单类型列表实现的指数编译时间.为什么
- 如何在BST的这个简单递归实现中消除警告
- 实现一个在集合上迭代的模板函数
- 我应该实现右值推送功能吗?我应该使用std::move吗
- 如何正确实现和访问运算符的各种自定义枚举器
- C++Union/Struct位域的实现和可移植性
- 这个极客对极客的trie实现是否存在内存泄漏问题
- 在c++中实现LinkedList时,应出现未处理的错误
- 为左值和右值的包装器实现C++范围
- 使用模板进行堆栈实现; "name followed by :: must be a class or namespace"
- 使用GSoap实现ONVIF
- 在用于格式4的arm模拟器中实现功能时的一个问题
- 用于AVX的ln(x)的实现,m256
- 用常见虚拟函数实现的任意组合来实现派生类的正确方法是什么
- 在C++中,如何在类和函数(可能是模板化的)的头中编写完整的实现
- std::random_device是如何实现的