I have defined a function as static in my class in this manner (snippet of relevant code)
#ifndef connectivityClass_H
#define connectivityClass_H
class neighborAtt
{
public:
neighborAtt(); //default constructor
neighborAtt(int, int, int);
~neighborAtt(); //destructor
static std::string intToStr(int number);
private:
int neighborID;
int attribute1;
int attribute2;
#endif
and in the .cpp file as
#include "stdafx.h"
#include "connectivityClass.h"
static std::string neighborAtt::intToStr(int number)
{
std::stringstream ss; //create a stringstream
ss << number; //add number to the stream
return ss.str(); //return a string with the contents of the stream
}
and I get an error (VS C++ 2010) in the .cpp file saying "A storage class may not be specified here" and I cannot figure out what I'm doing wrong.
p.s. I've already read this which looks like a duplicate but I don't know - as he does - that I am right and the compiler is being finicky. Any help is appreciated, I can't find any information on this!