Fixed a Solaris compile issue.

Solaris decided a declaration was actually a definition.
So, I changed the way templated static storage is declared. It
still needs to be defined once and only once on all platforms.
This commit is contained in:
Harry Moffat 2007-08-29 20:51:33 +00:00
parent 6f0ef653b0
commit e3d50370dd
3 changed files with 8 additions and 8 deletions

View file

@ -164,7 +164,7 @@ public:
return __table[n];
else {
throw Cantera::CanteraError("item","index out of range"+Cantera::int2str(n));
return __table[0];
//return __table[0];
}
}
@ -197,4 +197,11 @@ private:
bool _can_delete;
};
//! Declaration stating that the storage for the static member
//! of each instanteated template will exist
/*!
* The actual storage will be allocated in .cpp files
*/
template<class M> Cabinet<M>* Cabinet<M>::__storage;
#endif

View file

@ -35,9 +35,6 @@
using namespace std;
using namespace Cantera;
// declaration for the static storage
// -> The definition is located in ctxml.cpp
template<> Cabinet<XML_Node>* Cabinet<XML_Node>::__storage;
inline XML_Node* _xml(int i) {
return Cabinet<Cantera::XML_Node>::cabinet(false)->item(i);

View file

@ -61,10 +61,6 @@ inline ThermoPhase* _th(int n) {
}
// declaration for the static storage
// -> The definition is located in ctfunc.cpp
template<> Cabinet<Func1>* Cabinet<Func1>::__storage;
inline Func1* _func(int i) {
return Cabinet<Func1>::cabinet()->item(i);
}