octave-maintainers
[Top][All Lists]
Advanced

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

Re: templated bitwise operators


From: Jordi Gutiérrez Hermoso
Subject: Re: templated bitwise operators
Date: Fri, 25 May 2012 11:51:37 -0400

On 25 May 2012 11:22, c. <address@hidden> wrote:
> this changeset:
>
> changeset:   14631:57e4ff70b7c1
> user:        Jordi Gutiérrez Hermoso <address@hidden>
> date:        Sun May 13 21:17:19 2012 -0400
> summary:     Use more templates in bitwise operators. Death to macros! ☠
>
>
> introduced use of std::bit_and<T>, std::bit_or<T>, etc. which were
> introduced in gcc only in version 4.3. but I'm stuck with 4.2.1 on
> my system so that breaks the build for me ...

> would it be OK to add a configure check to go back to the
> macro-based version if any of those templates is undefined?

Death to macros! No more macros!

How about defining those templates instead? They're all pretty simple,
e.g.:

    template<typename T>
    T bit_and<T>(T a, T b)
    {
      return a & b;
    }

This isn't exactly the same as std::bit_and, but I think it should
work for this case.

What's the earliest gcc version we're targetting? Is it still 4.1 or
thereabouts? I can't wait to use C++11 features. I'm hoping next year
we can start doing that.

- Jordi G. H.


reply via email to

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