This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch 4/4] std::regex refactoring
- From: Daniel Krügler <daniel dot kruegler at gmail dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Tim Shen <timshen91 at gmail dot com>, "Stephen M. Webb" <stephen dot webb at bregmasoft dot ca>
- Date: Fri, 8 Nov 2013 15:51:04 +0100
- Subject: Re: [patch 4/4] std::regex refactoring
- Authentication-results: sourceware.org; auth=none
- References: <CAH6eHdSRGuFm_oMJnjLniZFw2nKdnKncCowOv_o4M7Ud3xgiLQ at mail dot gmail dot com>
2013/11/8 Jonathan Wakely <jwakely.gcc@gmail.com>:
> As I suggested yesterday on the libstdc++ list, this adds an overload
> for string and vector iterators to extract a raw pointer and re-use
> the _Compiler<const C*,...> specialization, so that std::regex(".")
> and std::regex(std::string(".")) and std::regex(std::vector<char>(1,
> '.')) only instantiate _Compiler<It,Tr> once.
>
> 2013-11-08 Jonathan Wakely <jwakely.gcc@gmail.com>
>
> * include/bits/regex_compiler.h (__detail::__compile_nfa): Overload
> so that std::basic_string<C> and std::vector<C> iterators dispatch to
> the const C* compiler.
I have fully not grasped for which T the specializations of
__has_contiguous_iter are intended to be used, but given the fact that
+ template<typename _Tp, typename _Alloc>
+ struct __has_contiguous_iter<std::vector<_Tp, _Alloc>>
+ : std::true_type
+ { };
exists I think you really want to exclude any vector<bool, Allocator>
by additionally adding
+ template<typename _Alloc>
+ struct __has_contiguous_iter<std::vector<bool, _Alloc>>
+ : std::false_type
+ { };
- Daniel