How do I make the following function inside a class and then access this function from main? My class is just a collection of a bunch of static functions.
t
Define the function in the .h file.
Works fine for me
a.h
#include
#include
using namespace std;
class A {
public:
template< typename T>
static double foo( vector arr );
};
template< typename T>
double A::foo( vector arr ){ cout << arr[0]; }
main.cpp
#include "a.h"
int main(int argc, char *argv[])
{
A a;
vector arr;
arr.push_back(1);
A::foo ( arr );
}