[Lldb-commits] [PATCH] D15187: Improve the functionality of JSONNumber

Enrico Granata via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 3 09:44:05 PST 2015


IIU my C++ correctly, this code covers neither int64_t nor double; it covers the unsigned variety of int64 - as well as any other unsigned integer type.

The main advantage (other than not relying on implicit promotions) would be that if someone writes their new integral data type (BigNum), and mark it with the appropriate traits, it would Just Work

- Enrico
Sent from my iPhone

> On Dec 3, 2015, at 9:34 AM, Greg Clayton <clayborg at gmail.com> wrote:
> 
> clayborg added a comment.
> 
> Everything looks good, just wondering why we need the template code? See inlined comments.
> 
> 
> ================
> Comment at: include/lldb/Utility/JSON.h:102-104
> @@ +101,5 @@
> +
> +        template <typename T,
> +                  typename std::enable_if<std::is_integral<T>{} &&
> +                                          std::is_unsigned<T>{}>::type* = nullptr>
> +        explicit JSONNumber (T u) :
> ----------------
> What value is the template code giving us? Why can't we omit this and just have a constructor with int64_t and double?
> 
> 
> http://reviews.llvm.org/D15187
> 
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151203/8e169a90/attachment.html>


More information about the lldb-commits mailing list