itaps-parallel technical issues in iMeshP.h
Onkar Sahni
osahni at scorec.rpi.edu
Mon Oct 6 12:05:13 CDT 2008
Jason,
Now if I look back at email I see that my response is disconnected to the
original issue raised on *inout* argument in iMeshP_destroyPartitionAll().
And my intent was not to comment on your style of coding.
- Onkar
> Onkar Sahni wrote:
> [snip example]
>>
>> I do not know if iMeshP_destroyPartitionAll() is completely necessary
>> but above example doesn't make it clear either as I would ask why would
>> one call iMeshP_destroyPartitionAll() in ~Partition() (destructor) with
>> no call to iMeshP_destroyPartitionAll() in Partition() (constructor)?
>>
>> class foo {
>> public:
>> foo(int *a) : acopy(a) {}
>> ~foo() { delete [] acopy; }
>> private:
>> int *acopy;
>> };
>>
>> int main(int argc, int *argv[]) {
>> int *a_try = new int;
>> foo foo1(a_try);
>> delete a_try;
>> return 1;
>> }
>>
>> a_try is not allocated in foo() but deleted in ~foo() and its not
>> array.
>>
>
> hether or not you like my coding style is irrelevant to the question of
> whether or not the handle passed to iMeshP_destroyPartitionAll should
> "inout", unless you are claiming that it will not be a problem for any
> code
> that you feel is "correct".
>
> - jason
>
> P.S. std::auto_ptr also violates your "rule".
>
>
>
>
>
>
More information about the itaps-parallel
mailing list