Indiana Unversity logo[ConceptGCC]

ConceptGCC :

Re: I have some Questions

From: Doug Gregor (dgregor_at_[hidden])
Date: 2008-09-09 10:01:00


On Aug 22, 2008, at 5:42 PM, hirohito none wrote:

> I have 3 questions.
>
> 1. I can call destructor
>
> auto concept Foo< typename T >
> { T::T() ; }
>
>
> template < typename T > requires Foo < T >
> void f()
> {
> T x ;
> // destructor will be called.
> }
>
> Is this a valid code? or ill-formed?

Ill-formed; you would need a destructor requirement. ConceptGCC fails
to diagnose this.

>
> 2. I can not call destructor
>
> auto concept Bar< typename T >
> {
> T::T() ;
> T::~T() ;
> }
>
> template < typename T > requires Bar< T >
> void g()
> {
> T x ;
> x.~T() ;// error: the type being destroyed is 'T', but the
> destructor refers to 'T'
> }
>
> Although destructor is called twice, I think it should be compiled.

It should compile.

>
> 3. I can not require operator new in concept
> ConceptGCC does not supported it yet?

IIRC, there is some basic support for this in the Subversion version
of ConceptGCC, but it's not very solid.

        - Doug