gsl::span
混合バイナリ/ASCIIデータのパックされた構造(したがって novector
またはstring
)から正規表現で操作したい関数にデータを渡すために使用しようとしていますが、次のエラーが発生します:
エラー C2784: 'bool std::regex_match(_BidIt,_BidIt,std::match_results<_BidIt,_Alloc> &,const std::basic_regex<_Elem,_RxTraits> &,std::regex_constants::match_flag_type)': 推定できませんでした'std::cmatch' からの 'std::match_results>,_Alloc> &' のテンプレート引数
「std::regex_match」の宣言を参照してください
これが私がやろうとしていることです:
#include <regex>
#include "gsl.h"
using namespace std;
using namespace gsl;
int main(int argc, const char **argv)
{
char lat[8] = { '0', '1', '9', '0', '0', '0', '0', 'E' };
span<char> s = lat;
// in a complex implementation this would be in a function,
// hence the desire for span<>
std::cmatch match;
std::regex_match(s.begin(), s.end(), match, std::regex("[0-9]+"));
}