Open juntuu opened 3 years ago
This is awesome! Will do a live code review on the next live stream!
CI compiler is giving somewhat ambiguous error:
../jsrc/conversions.cpp:565:71: error: call of overloaded ‘jtccvt(JST*&, <unnamed enum>, AD*&, AD**)’ is ambiguous
--
No idea how it thinks jtccvt()
from all the functions would be overloaded...
Turned out the CI compiler had different idea of I
compared to int64_t
The main funtion doing the conversion work is
convert<From, To>()
. The external interface is unchanged (except B -> bool).From
may exceedTo
s value range.std::optional<T>
, astd::nullopt
signals failure and is checkedAlso added template parameter to specify return type of
pointer_to_values()
(https://github.com/codereport/jsource/pull/200/commits/e9e7f414ff0a8d5e9416630cf642c0729c50c72a). This changes the semantics ofset_value_at()
to depend on the type of thevalue
:This allows use of
set_value_at()
with types wider than, or not convertible to,int64_t
. However, this requires more care with thevalue
parameter, it must be the correct type (correct bit width), to get the correct stride.