S
sam.barker0
Hi all,
I have this following error
In test.h
===========================================
#include <iostream>
#include <cstddef>
#include <utility>
template<typename T> class myclass;
template<typename T> std:stream& operator<< (std:stream&, const
myclass<T>&);
template <typename T> class myclass {
public:
friend std:stream& operator<< <T> (std:stream& os, const
myclass<T>& var1);
....
...
...
private:
struct mysubclass
{
int par1;
int par2;
};
};
#include "myclass.tem"
=============================================
In myclass.tem,I have
===============================================
#include <cassert>
#include <algorithm>
template<typename T>
std:stream& operator<< (std:stream& values, const myclass<T>&
var1)
{
typename myclass<T>::mysubclass *current;
current->par1=89;
.................................
....................................
}
When I compile I get the error
In myclass.tem
error: ‘par1’ was not declared in this scope
What am I doing wrong.How can solve this.
Cheers,
Sam
I have this following error
In test.h
===========================================
#include <iostream>
#include <cstddef>
#include <utility>
template<typename T> class myclass;
template<typename T> std:stream& operator<< (std:stream&, const
myclass<T>&);
template <typename T> class myclass {
public:
friend std:stream& operator<< <T> (std:stream& os, const
myclass<T>& var1);
....
...
...
private:
struct mysubclass
{
int par1;
int par2;
};
};
#include "myclass.tem"
=============================================
In myclass.tem,I have
===============================================
#include <cassert>
#include <algorithm>
template<typename T>
std:stream& operator<< (std:stream& values, const myclass<T>&
var1)
{
typename myclass<T>::mysubclass *current;
current->par1=89;
.................................
....................................
}
When I compile I get the error
In myclass.tem
error: ‘par1’ was not declared in this scope
What am I doing wrong.How can solve this.
Cheers,
Sam