compile-time-regular-expressions
compile-time-regular-expressions copied to clipboard
Compilation failure in VS2017
MSVC 14.16.27023 cannot find the unqualified find_captures
. changing it to ::ctre::find_captures
seems to fix this.
build log excerpt
code excerpt:
constexpr auto JOURNAL_PAGE_PATTERN = ctll::fixed_string{"^journal_(\\d+)$"};
using std::filesystem::path;
std::optional<unsigned long> matchJournalPage(path const& path)
{
if (auto matches =
ctre::match<JOURNAL_PAGE_PATTERN>(path.filename().string()))
return std::stoul(matches.get<1>().to_string());
else
return std::nullopt;
}
changing the definition:
template <typename ResultIterator, typename Pattern>
using return_type = decltype(regex_results(std::declval<ResultIterator>(),
find_captures(Pattern{})));
to
template <typename ResultIterator, typename Pattern>
using return_type = decltype(regex_results(std::declval<ResultIterator>(),
::ctre::find_captures(Pattern{})));
fixes this issue