lmi
[Top][All Lists]
Advanced

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

Re: [lmi] use value_or() directly


From: Greg Chicares
Subject: Re: [lmi] use value_or() directly
Date: Thu, 7 Jun 2018 14:55:52 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 2018-06-07 12:46, Vadim Zeitlin wrote:
> On Thu,  7 Jun 2018 06:37:04 -0400 (EDT) Greg Chicares <address@hidden> wrote:
> 
> GC> branch: master
> GC> commit cf7df5333fb2f4f6154aba7d8cd2da8d88565a01
[...]
> GC>  template<typename T, typename U>
> GC>  inline
> GC>  T get_value_or(std::optional<T> const& o, U v)
> GC>  {
> GC> -    return o ? *o : v;
> GC> +    return o.value_or(v);
> GC>  }
> 
>  I don't think we need get_value_or() any more, it was only a replacement
> for the missing value_or() but now that we can use it directly, it only
> makes things less clear.
> 
>  Please let me know whether I should make a PR replacing get_value_or(o, v)
> with o.value_or(v) calls or if you prefer to make this trivial change
> yourself.

Let me make the change. I'll wait to see whether you have any other
comments about other changes I made to 'rate_table*.?pp' this morning
before I do that. Reason: I noticed loop counters of type std::uint16_t,
but didn't see any gigantic tables in the unit test, so I decided I'd
better regenerate and test all the 600 or so proprietary tables that
are used by lmi today, before pushing any change--and that takes time.
(I could automate that, but I'm not sure we should add automated tests
that don't work without proprietary data. We could use the data files
for 'sample', but then I'd have to designate a canonical location for
their corresponding '.table' files, and that takes time.)



reply via email to

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