Re: SourceComment: Using typedefs

I agree with you we should use typedefs! What about keeping the style for class names and name it BItemPtr or BItemPointer. I’ve read somewhere, sorry I can provide a reference, that it is a better style to avoid abbreviations like ‘ptr’ or ‘wnd’, ‘addr’. I think the idea is to make the source more readable… Qt also tends to use the no abbreviations (e.g. QSharedDataPointer, QHostAddress).

Should we say (in the conventions) and require that boost::scoped_ptr is used for local pointers, or should we prefer to use only std::auto_ptr? If we use both than we would need different names for the typedefs: e.g. BItemPointer and BItemScopedPointer? Maybe just for the sake of simplicity let’s say that auto_ptr should be used for local variables as well?

And what about BItem::Pointer?

Regards,

Peter

atul wrote:Dear all

class BDecoder {

typedef std::auto_ptr BItem_Ptr;

….
return std::auto_ptr( new BErrorItem );

return BItem_Ptr( new BErrorItem );

— cheers atul

Would you like to post a relpy?


This post is a reply to:
SourceComment: Using typedefs
Dear all class BDecoder { typedef std::auto_ptr BItem_Ptr; ....       return std::auto_ptr( new BErrorItem ); return BItem_Ptr( new BErrorItem ); --- cheers atul

No follow-ups yet.