Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Class templates and inlining (OT)

Author: Sune Fischer

Date: 14:58:22 12/23/02

Go up one level in this thread


On December 23, 2002 at 17:38:39, David Rasmussen wrote:

>There are several possibilities:
>1. MSVC6 is not the most compliant compiler on earth, so don't expect anything
>2. Maybe you are using this the wrong way? If you wrap things in a class, you
>will have to explicitly give the type argument when you use the static member
>functions:
>
>	int c=CUtil<int>::Max(a,b);
>
>Which is maybe not quite what you wanted. But that what you made :)
>You might want to wrap the functions in a namespace instead.

Yes, I looked over the STL, and I think I prefer the namespace, although that is
cumbersome in its own way.

>There are several
>different ways of doing what you want to do. The best thing is for you to learn
>how on your own. And if you really have to ask somebody, ask in comp.lang.c++,
>not CCC :)

LOL, those are the kind of answers i would have gotten in comp.lang.c++ those no
good for nothing "start small" and "learn how to program" advises, somehow I
find it very insulting :)

Besides compared to the high number of posts containing little else than
personal attacks, I think this is on-topic. For sure you people here can
understand why I can't possibly accept 15% loss of speed, in comp.lang.c++ they
would never understand that. Before you know it the whole thread has become a
debate of whether the 15% is "worth it" or not :)

>
>Inlining hasn't been a practical problem with me, with MSVC. I just put the
>relevant parts in a header file.
>
>C++ isn't slower for chess programming than C if used right. C++ can easily be
>faster than C. The most important benefit though, is the type safety and the
>superior designs possible.
>
>/David

Yes, you don't have to convice me :)
I have changed most of my macros to inlined functions, and have seen no drop in
speed yet.

-S.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.