What all you must consider to provide in a class you write? Check the following:
Hope this helps
Cheers and try hosting at Linode.
Monish
- Constructors and Destructor as well as memory allocation and deallocation fuctions.
- Object Initialization vs. Object Assignment.
- Copy constructor to pass objects by value.
- Error checking for object values outside legal range allowed, specially in constructors, assignment operators and "setter" functions.
- Declare virtual functions and virtual destructor depending upon: if you want to allow others to inherit this class.
- Type Conversion functions and constructors.
- Provide required functionality by defining functions and Overloaded operators.
- Disallow suitable standard funtions. (COPY CTOR etc.)
- Use access specifiers depending upon who will be allowed to access particular members.
- What kind of guarantee does the class provide in terms of exception safety, resource usage?
- Make your class generic using class template if required.
- Is this class is what you need? Can't this be achieved through a function?
Hope this helps
Cheers and try hosting at Linode.
Monish
No comments:
Post a Comment