oh, I've done that. or rather I've done correctly for pp and then when it didn't work and I created the "testmap" I forgot it (adding non-relevant 1 error line to the flaglist that I obviously chose to post here...)
ok, to avoid confusions here is all the relevant code (that I should have given from the start):
Code:
#ifndef PROJECTNAME_TOOLS_H
#define PROJECTNAME_TOOLS_H
#include <map>
struct particle_properties{
/**This struct holds general paticles data (Mass, Charge, etc). **/
/**It's purpose is to hold data of individual particles that will **/
/**then be called by "ppfromID" (which will hold one **/
/**particle_properties object for each particle of the SM). **/
/**Exotic particles added will also be stored here. **/
public:
particle_properties(double,int);
particle_properties(double,int,double);
double mass;
int charge; //(in units of e/3)
double evaporation_weight;
};
class ppfromID{
public:
ppfromID(void);
private:
void init(void);
static bool initiated;
static std::map<int,particle_properties> pp;
static std::map<int,double> testmap; //TO BE REMOVED!!!
};
Code:
#include "projectname_tools.h"
using namespace std;
particle_properties::particle_properties(double m,int q){
/**CONSTRUCTOR**/
mass=m;
charge=q;
evaporation_weight=0.0;
}
/**static data for ppfromID**/
bool ppfromID::initiated=false;
map<int,particle_properties> ppfromID::pp;
map<int,double> ppfromID::testmap;
/****************************/
ppfromID::ppfromID(void){
/**CONSTRUCTOR**/
if (initiated=false){
init();
initiated=true;
}
}
void ppfromID::init(void){
/**Initiates the class (adds the SM particles and their properties)**/
pp[1]=particle_properties(.32,1);
testmap[1]=double(.32);
}
the error message given is error: no matching function for call to ‘particle_properties::particle_properties(). Indicating that the problem is likely how the struct declaration interacting with the map. I tried this...
Code:
particle_properties temp_pp(.32,1);
pp[1]=temp_pp;
...with similar results.
any idea what I'm doing wrong?