Menu

#123 potential naming confilict

closed
None
5
2007-02-25
2007-02-08
Anonymous
No

Dear all,

using loki library 0.1.5 I found a kind of strange problem or better potential problem.

In same places inside SmallObj.h it is used CS as a template parameter. Here is an example:
template
<
template <class, class> class TM,
std::size_t CS,
.....
>
void AllocatorSingleton< TM, CS, ...., LP, MX >::ClearExtraMemory( void )
{
typename MyThreadingModel::Lock lock;
(void)lock; // get rid of warning
Instance().TrimExcessMemory();
}

I had problem with that and I found that the problem was due to conflict with another library (RTAI). This library defines at some place CS (#define CS 4532) which is than used to replace CS in the template parameter list.
I fixed this problem by simple renaming CS and some other template parameters (you can see the attached file).
I think that using too short names in template parameter list (and also on other places) could cause naming conflict with some other library (not just RTAI as in my case)

What I would like to suggest is that you replace those short names for template parameter whit something longer.

Regards
Bogdan J

Discussion

  • Nobody/Anonymous

    Fixed SmallObj.h

     
  • Peter Kuemmel

    Peter Kuemmel - 2007-02-25
    • assigned_to: nobody --> syntheticpp
    • status: open --> closed
     

Log in to post a comment.