Indiana Unversity logo[ConceptGCC]

ConceptGCC :

Re: I have some Questions

From: hirohito none (hitobasira_at_[hidden])
Date: 2008-09-14 15:01:57


On Tue, Sep 9, 2008 at 11:01 PM, Doug Gregor <dgregor_at_[hidden]> wrote:
>
> 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
> _______________________________________________
> ConceptGCC mailing list
> ConceptGCC_at_[hidden]
> http://www.osl.iu.edu/mailman/listinfo.cgi/conceptgcc
>

Thanks.
In particular, I really want to know about Question 1.