http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49022
Summary: [C++0x] std::begin and std::end specialized for std::valarray with some operators are missing. Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: fl...@flast.jp Currently, std::begin and std::end specialized for std::valarray are exist. However operators for std::valarray are using Expression Template technique. And std::begin and std::end specialized for those are not exist. For example, GCC rejects following code. ==== testcase.cc ==== #include <valarray> void f() { std::valarray<int> x,y; std::begin(x + y); } ==== output: $ g++-4.6 -std=c++0x testcase.cc testcase.cc: In function 'void f()': testcase.cc:6:23: error: no matching function for call to 'begin(std::_Expr<std::_BinClos<std::__plus, std::_ValArray, std::_ValArray, int, int>, int>)' testcase.cc:6:23: note: candidates are: /usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/initializer_list:86:38: note: template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>) /usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/bits/range_access.h:48:57: note: template<class _Container> decltype (__cont->begin()) std::begin(_Container&) /usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/bits/range_access.h:58:63: note: template<class _Container> decltype (__cont->begin()) std::begin(const _Container&) /usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/bits/range_access.h:87:28: note: template<class _Tp, unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm]) /usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/valarray:1126:30: note: template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&) /usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/valarray:1136:36: note: template<class _Tp> const _Tp* std::begin(const std::valarray<_Tp>&)