N
New_user
Hello.
Excerpt from ISO/IEC 14882 :
14/6
A namespace-scope declaration or definition of ........skipped...... a non-
inline member function of a class template or a static data member of a class
template may be preceded by the export keyword.
and from http://www.comeaucomputing.com/4.3.0/minor/win95+/43stuff.txt :
A template must be declared export at both the point of definition and
the point of reference.
I have some files:
//templ.h
template<class T>
class A
{
public:
void fun();
static int i_;
};
//I want to export A<T>::fun and A<T>::i_, but I do not want to declare class
//A as exported
//def.cpp
//1!
//exported definitions are here, ordering problems?
//fun first declared as non-exported and later as exported?
export template<class T>
void A<T>::fun()
{
}
export template<class T>
int A<T>::i_ = 0;
//user.cpp
//2! here's class usage
#include "templ.h"
int main()
{
A<int>a;
a.fun();
}
How can I declare A<T>::fun in user.cpp as exported at the point of reference?
Excerpt from ISO/IEC 14882 :
14/6
A namespace-scope declaration or definition of ........skipped...... a non-
inline member function of a class template or a static data member of a class
template may be preceded by the export keyword.
and from http://www.comeaucomputing.com/4.3.0/minor/win95+/43stuff.txt :
A template must be declared export at both the point of definition and
the point of reference.
I have some files:
//templ.h
template<class T>
class A
{
public:
void fun();
static int i_;
};
//I want to export A<T>::fun and A<T>::i_, but I do not want to declare class
//A as exported
//def.cpp
//1!
//exported definitions are here, ordering problems?
//fun first declared as non-exported and later as exported?
export template<class T>
void A<T>::fun()
{
}
export template<class T>
int A<T>::i_ = 0;
//user.cpp
//2! here's class usage
#include "templ.h"
int main()
{
A<int>a;
a.fun();
}
How can I declare A<T>::fun in user.cpp as exported at the point of reference?