Home » U++ Library support » U++ Core » PolyDeepCopyNew: MSC / GCC differ in behaviour
Re: PolyDeepCopyNew: MSC / GCC differ in behaviour [message #29388 is a reply to message #29363] |
Mon, 18 October 2010 09:35   |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
hi mirek
it's connected because i used PolyDeepCopyNew to specify the DeepCopyNew function to use the t.Copy() function, which is obligatoryly defined in Copyable<> (to make sure it is implemented) and accessible from this interfaces).
the weired point is, in MSC it works.. gcc does not recognize the friend DeepCopyNew as the specialisation from template DeepCopyNew, or the containers (here Array) doent get to understand that a global DeepCopyNew is available (from PolyDeepCopyNew, as friend), withtout the need to use the template DeepCopyNew..
with which mingw version did it work for you?
EDIT:
maybe it's the same problem that led you or the guys to implement the Moveable<> in the way it is done now.
template <class T>
inline void AssertMoveable(T *t = 0) { if(t) AssertMoveable0(t); }
#if defined(COMPILER_MSC) || defined(COMPILER_GCC) && (__GNUC__ < 4 || __GNUC_MINOR__ < 1)
#define NTL_MOVEABLE(T) inline void AssertMoveable0(T *) {}
#else
#define NTL_MOVEABLE(T) template<> inline void AssertMoveable<T>(T *) {}
#endif
maybe because there are problems with recognition of the template / friend function same names ...
[Updated on: Mon, 18 October 2010 11:40] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Aug 24 20:22:08 CEST 2025
Total time taken to generate the page: 0.05012 seconds
|