[Lldb-commits] [PATCH] D15187: Improve the functionality of JSONNumber
Tamas Berghammer via lldb-commits
lldb-commits at lists.llvm.org
Thu Dec 3 09:47:54 PST 2015
tberghammer added inline 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) :
----------------
clayborg wrote:
> What value is the template code giving us? Why can't we omit this and just have a constructor with int64_t and double?
If we have a constructor with int64_t and one with double then we will get a compilation error when we try to call it with an int32_t because the 2 overload will be ambiguous. We can work it around at each call site with casting the value to the type what the constructor takes but I would prefer to handle the issue it in 1 place instead of all call site.
http://reviews.llvm.org/D15187
More information about the lldb-commits
mailing list