This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[RFC] libstdc++/8780
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Cc: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Date: Mon, 02 Dec 2002 14:03:42 +0100
- Subject: [RFC] libstdc++/8780
Hi Gaby, hi everyone,
I'm looking a bit into this PR. This is the testcase:
//////////
#include <vector>
template<int> struct static_assert_test{};
template <bool> struct STATIC_ASSERTION_FAILURE;
template <> struct STATIC_ASSERTION_FAILURE<true>{};
#define BOOST_STATIC_ASSERT( B ) static_assert_test<sizeof(STATIC_ASSERTION_FAILURE< ( B ) >)>
template <typename T> struct is_pointer_helper
{ static const bool value = false; };
template <typename T> struct is_pointer_helper<T*>
{ static const bool value = true; };
template <typename T> struct is_pointer_helper<T*const>
{ static const bool value = true; };
template <typename T> struct is_pointer_helper<T*volatile>
{ static const bool value = true; };
template <typename T> struct is_pointer_helper<T*const volatile>
{ static const bool value = true; };
int main(void)
{
BOOST_STATIC_ASSERT(is_pointer_helper<std::vector<int>::iterator>::value);
return(0);
}
//////////
The compilation fails with any v3. This seems due to the fact that,
whereas in v2, for std::vector, simply:
typedef value_type* iterator;
in v3:
typedef __gnu_cxx::__normal_iterator<pointer, vector_type> iterator;
Submitter cites 24.1,(1,2) as implying that the current implementation is
non conforming. This seems to me non at all obvious! It is just a QoI issue?
(in few other widespread implementations iterator *is* just a pointer)
Much more generally, I'm interested in knowing why the implementation
of iterator was changed in such a way in the transition between v2 and v3.
Thanks for the attention,
Paolo.