help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoiding "spurious" compiler warning


From: Lionel B
Subject: Re: Avoiding "spurious" compiler warning
Date: 4 Nov 2004 01:27:45 -0800
User-agent: G2/0.2

Guy Harrison wrote:
> Lionel B wrote:
>
> [...]
>
> > Any work-arounds / ideas for suppressing the essentially spurious
> > warning?
>
> Hmm, I'm not sure I'd want to but fwiw...
>
> template <typename T> inline void
> asl(T& x, unsigned n)
> {
>  x <<= n;
> }
>
> ...
>
> if (sizeof(T) > sizeof(unsigned long))
>  asl(x,std::numeric_limits<unsigned long>::digits)
> ;
>
> ...anything that dispenses with "x <<= literal" should suffice.
Thanks Guy, that works nicely.

-- 
Lionel B



reply via email to

[Prev in Thread] Current Thread [Next in Thread]