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 <clayb...@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 > > >
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits