This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Implementation of n3793 <experimental/optional>
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Luc Danton <lucdanton at free dot fr>
- Date: Sun, 3 Nov 2013 11:19:16 +0000
- Subject: Re: [Patch] Implementation of n3793 <experimental/optional>
- Authentication-results: sourceware.org; auth=none
- References: <5260CFE7 dot 7000808 at free dot fr> <CAH6eHdTs43dT6yY=tfL9mfWHKAR3yZ-2j02Scs8FW4zUE=L6=w at mail dot gmail dot com> <52729DF5 dot 6020806 at free dot fr> <CAH6eHdQ9bwMD0Awh9bivCTb83na8i1od6pyqRMULmY48a2-x-A at mail dot gmail dot com> <87eh6x3jdp dot fsf at igel dot home>
On 3 November 2013 09:49, Andreas Schwab wrote:
> Jonathan Wakely <jwakely.gcc@gmail.com> writes:
>
>> + {
>> + std::experimental::optional<long> o { std::experimental::in_place, 0x1234ABCDF1E2D3C4 };
>> + auto copy = o;
>> + VERIFY( copy );
>> + VERIFY( *copy == 0x1234ABCDF1E2D3C4 );
>> + VERIFY( o && o == 0x1234ABCDF1E2D3C4 );
>> + }
>
> experimental/optional/cons/copy.cc:70:20: error: no match for 'operator==' (operand types are 'std::experimental::optional<long int>' and 'long long int')
> VERIFY( o && o == 0x1234ABCDF1E2D3C4 );
> ^
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?