contributor.h wrote:#ifndef CONTRIBUTOR_H //Preprocessor directives to prevent duplicate
#define CONTRIBUTOR_H // declarations. Use the file name of the identifier
//substituting an _ underscore for the period
//====================================================================
// CONSTANT DEFINITIONS
// formatting constants:
const int nameWidth = 30;
//******************************************************************************
// STANDARD AND USER DEFINED INCLUDES
#include <string>
#include <iostream>
using namespace std;
//******************************************************************************
// USER DEFINED DATA TYPES
class Contributor{
//friend functions
friend ostream & operator<<(ostream &out, Contributor RHS);
friend istream & operator>>(istream &in, Contributor &RHS);
static bool CompareByAlpha;
private:
string Name;
double Contribution;
Gender Sex;
int IDKey;
};
//******************************************************************************
// END OF CONDITIONAL BLOCK
#endif
//pop the stacks onto the final list
list<Contributor> Seating;
Seating.push_front(Contributor(string("Guest of Honor")));
"preemptive killing of cops might not be such a bad idea from a personal saftey[sic] standpoint..." --Keevan Colton
"There's a word for bias you can't see: Yours." -- William Saletan
MSDN for error C2558 wrote:
'identifier' : no copy constructor available or copy constructor is declared 'explicit'
A copy constructor initializes an object from another object of the same type. (It makes a copy of the object.) The compiler generates a default copy constructor if you do not define any constructors.
Possible cause
Trying to copy a class whose copy constructor is private. In most cases, a class with a private copy constructor should not be copied. A common programming technique declares a private copy constructor to prevent the direct use of a class. The class may be useless by itself or require another class in order to work properly.
Trying to copy a class whose copy constructor is explicit. Declaring a copy constructor with explicit prevents passing/returning objects of a class to/from functions.
Possible solution
If you determine that it is safe to use a class with a private copy constructor, derive a new class from the class with a private constructor and make a public or protected copy constructor available in the new class. Use the derived class in place of the original.
For more information, see Compiler Errors when Implementing a CObject-Derived Class.
Have you tried declaring your private members as protected? Its been a long time since I've messed with copy constructors.
I melt two faces in the morning. I melt two faces at night. I melt two faces in the afternoon, it makes me feel alright. I melt two faces in time of peace, and two in time of war. I melt two faces before I melt two faces, and then I melt two more. - Ballad of a PK
"preemptive killing of cops might not be such a bad idea from a personal saftey[sic] standpoint..." --Keevan Colton
"There's a word for bias you can't see: Yours." -- William Saletan