I have a template function defined as follows:

```
template<class T>
string toString(T value) {

     ostringstream ss;

     if (is_same<T, Student>::value) {
         ss << value.getFirst() << ":" << value.getLast() << ":" << value.getId() << ":" << value.getGpa();
         return ss.str();
     }

     else {
         //ss << value;
         return ss.str();
     }
}

```

If i were to call this function like so:

```
int main(){

      Student studentObj;
      toString(studentObj);

}

```

How do i access this classes various members from the toString function?

I have tried (errors commented)

```
value.getId() //Returns int 
//Error C2228 left of '.getId' must have class/struct/union 

```

and

```
value<Student>.getId()
//Error C2275 'Student': illegal use of this type as an expression  

```

Thanks in advance!

edit: Class definition

```
class Student {
protected:
    std::string firstname;
    std::string lastname;
    int id;
    float gpa;
public:
    Student();
    Student(std::string, std::string, int, float);
    Student(const Student &);
    std::string getFirst();
    std::string getLast();
    int getId();
    float getGpa();
};

```