This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Implementation of n3793 <experimental/optional>


On 3 November 2013 11:30, Paolo Carlini wrote:
> On 11/03/2013 12:19 PM, Jonathan Wakely wrote:
>>
>> Yes, Paolo pointed out these are failing on 32-bit targets, I've got a
>> patch coming. Luc is there any reason not to just replace all those large
>> constants with 0x1234ABCD, which fits in a long on 32-bit targets?
>
> By the way, that's what I did/hacked in my local tree ;)

I needed some other changes, otherwise comparing optional<long>{} ==
0x1234ABCD doesn't compile, because 0x1234ABCD is an int and
optional<T> doesn't support comparisons with anything except T.

> Jon, I have got a bunch of other minor tweaks, from proper formatting of
> conditional operator and some curly braces, to using __and_ and __not_ when
> possible, and other thingies, like no full stops at the end of asserts and
> throws. Passes testing. You may want to integrate it with your other changes
> in testing... Or I can wait and apply it myself.

Here's the combined patch, tested x86_64-linux, 64-bit and 32-bit,
committed to trunk.

2013-11-05  Jonathan Wakely  <jwakely.gcc@gmail.com>
            Paolo Carlini  <paolo.carlini@oracle.com>

        * include/experimental/optional: Use __and_<> and __not_<> in
        conditions. Style fixes.
        (__constexpr_addressof, swap): Make inline.
        * testsuite/experimental/optional/cons/copy.cc: Adjust constants for
        32-bit targets.
        * testsuite/experimental/optional/cons/move.cc: Likewise.
        * testsuite/experimental/optional/cons/value.cc: Likewise.
        * testsuite/experimental/optional/constexpr/cons/value.cc: Likewise.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]