This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch 4/4] std::regex refactoring


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]