[ConceptGCC] |
ConceptGCC :ame type constaints, references, and temporaries |
From: Jeremy Siek (jeremy.siek_at_[hidden])
Date: 2007-02-15 17:34:56
>
> Found this one while working on the new iterator concepts and
> iter_swap.
>
> /opt/conceptgcc-4.1.1-alpha-4/bin/c++ same_type_ref.cpp -o
> same_type_ref
> same_type_ref.cpp: In function 'void blah(X&)':
> same_type_ref.cpp:13: error: invalid initialization of non-const
> reference of type 'typename Iter<X>::value_type&' from a temporary
> of type 'typename Iter<X>::reference'
>
> #include <concepts>
>
> concept Iter<typename X> {
> typename reference;
> typename value_type;
> reference operator*(X);
> };
>
> template<Iter X>
> where std::SameType<X::reference, X::value_type&>
> void blah(X& x) {
> X::value_type& z = *x;
> }
>
> int main(){ }
______________________________________
Jeremy Siek <jeremy.siek_at_[hidden]>
http://www.cs.colorado.edu/~siek/
Visiting Assistant Professor
Department of Computer Science
University of Colorado at Boulder