Originally Posted by
cpjust
Re: compile errors on VC++ vs. gcc
Are you compiling with Warning Level 4? VC++ defaults to Warning Level 3 for some stupid reason. You can also add /Wall to the compile options for a ton of errors.
Yes, I always use level 4 warnings.
I also ticked every option for warnings I could find in GCC. Both pedantic and -wall.
Re: friend functions
Why would your == operators need to be friends? As long as they don't try to use any private data or functions, they can be non-member AND non-friend functions.
Well... I would say yes, seeing as it must have access to internals to assign.
But even if not, I'd like to understand how it works.
Re: Diff program
I believe the non-express VC++ should come with WinDiff, but I prefer the Diff program in Perforce. You should install Perforce anyways, if you don't already have a version control system.
http://www.perforce.com/
It's free to use for single-user usage, and it's much more intuitive and easier to use than something like CVS or even VSS.
Hmmm. I don't see WinDiff.
I'll check out Perforce.
Ah, it compiles now.
I'm guessing the <> tags plus explicit template tags are required to compile it correctly. That plus you need declarations of the template names that you reference with the templates:
Code:
friend CTmplStringBase<T, Traits>& operator += <> (CTmplStringBase<T, Traits>& rlhs, const T* strData);
Green = Explicit type for the class
Red = Needed to mention it's a template I guess.
Code:
template<typename T, typename Traits> class CTmplStringBase;
Needed to tell the compiler the template names mentioned above really do exist.